Using the privacy permission dialog

Updated at:

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

Important

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.

  1. 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>
  2. Use the following API to send the Agree broadcast.

    Note

    Send the broadcast only after the user clicks Agree.

    QuinoxlessPrivacyUtil.sendPrivacyAgreedBroadcast(Context context);
  3. Check if the user has agreed to the privacy permissions.

    Note

    Before calling this API, initialize the mPaaS framework.

     QuinoxlessPrivacyUtil.isUserAgreed(Context context);
  4. Update the user consent flag for privacy permissions to redisplay the dialog in specific scenarios.

    QuinoxlessPrivacyUtil.setUserAgreedState(Context context, **boolean **agreed);
  5. Handle the callback that is invoked when framework initialization is complete.

    • If you use QuinoxlessApplicationLike, use mPaaS features after the onMPaaSFrameworkInitFinished callback.

      Note

      You must use QuinoxlessApplicationLike if you need the hotpatching feature.

    • If you do not use QuinoxlessApplicationLike, use mPaaS features after the onPostInit method in the IInitCallback callback.

      QuinoxlessFramework.setup(this, new IInitCallback() 
      {
      @Override
        public void onPostInit() 
      {
      
      }
      });
  6. 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.