Using the privacy permission dialog
Regulatory compliance requires that apps must not call sensitive APIs before the user clicks Agree in the privacy policy dialog. mPaaS for Android supports this requirement in all versions of the 10.1.68 baseline, version 10.1.60.5 and later of the 10.1.60 baseline, and version 10.1.32.16 and later of the 10.1.32 baseline. If your project uses the Framework component, modify your project as described below.
Usage instructions
Display a privacy permission dialog in your app. After the user agrees, call the framework API to send an Agree broadcast. The framework then completes initialization and records consent in sharedpreference. Once initialization is complete, the framework notifies your app through a callback. You can use mPaaS component features only after you receive this callback.
Procedure
The Activity that displays the privacy dialog must not inherit from the mPaaS BaseActivity, because BaseActivity performs data-collection instrumentation that would cause the app to collect private data before the user agrees to the privacy policy.
-
In
meta-data, configure the switch for the privacy permission dialog. This feature is disabled by default.<meta-data android:name="privacy_switcher" android:value="true"></meta-data> -
Use the following API to send the Agree broadcast.
NoteSend the broadcast only after the user clicks Agree.
QuinoxlessPrivacyUtil.sendPrivacyAgreedBroadcast(Context context); -
Check if the user has agreed to the privacy permissions.
NoteBefore calling this API, initialize the mPaaS framework.
QuinoxlessPrivacyUtil.isUserAgreed(Context context); -
Update the user consent flag for privacy permissions to redisplay the dialog in specific scenarios.
QuinoxlessPrivacyUtil.setUserAgreedState(Context context, **boolean **agreed); -
Handle the callback that is invoked when framework initialization is complete.
-
If you use
QuinoxlessApplicationLike, use mPaaS features after theonMPaaSFrameworkInitFinishedcallback.NoteYou must use
QuinoxlessApplicationLikeif you need the hotpatching feature. -
If you do not use
QuinoxlessApplicationLike, use mPaaS features after theonPostInitmethod in theIInitCallbackcallback.QuinoxlessFramework.setup(this, new IInitCallback() { @Override public void onPostInit() { } });
-
-
If you use baseline version 10.1.68.42 or later and need to clear the privacy status, call
QuinoxlessPrivacyUtil.clearPrivacyState(context);before making any of the other API calls mentioned in this procedure.