pavelzaichyk / flutter_unity_ads

Unity Ads plugin for Flutter Applications. This plugin is able to display Unity Banner Ads and Unity Video Ads.
https://pub.dev/packages/unity_ads_plugin
MIT License
31 stars 12 forks source link

How to disable cookie collect prompts #34

Closed afu-hive closed 1 year ago

afu-hive commented 1 year ago

IOS Reject my app cause using custom prompts. what should I do to remove that popup or replace that with App Tracking Transparency ?

image

message from IOS

We noticed you do not use App Tracking Transparency to request the user's permission before collecting data used to track them. Instead, your app displays a custom prompt that requests the user to allow tracking.

Starting with iOS 14.5, apps on the App Store need to receive the user’s permission through the AppTrackingTransparency framework before collecting data used to track them. Requesting permission with a custom prompt is not appropriate.

Next Steps

If your app collects data in order to track users, you must take the following steps:

  1. If you haven't already, update your app privacy information in App Store Connect to disclose that you track users. You must have the Account Holder or Admin role to update app privacy information.

  2. Implement App Tracking Transparency.

  3. Remove the custom prompts, and request permission using the AppTrackingTransparency framework before collecting data used to track the user. When you resubmit, indicate in the Review Notes where the permission request is located.

You may also choose to remove the tracking functionality from your app, as well as the custom prompts to allow tracking.

thank you

afu-hive commented 1 year ago

finally I got solution who ever app-store reject like me follow this code below

1st you have to ask for ATT 2nd set consent 3rd init unity ads

more detail => https://forum.unity.com/threads/app-rejected-because-unity-ads-own-data-collection-permission-request-violates-att-guidelines.1103065/?fbclid=IwAR0WGUTfo3aDCfGhMFnpZloSkD3d66JNreiSI-q2e2KuG7_TuUdQ52Fp9Sc

void initAds() async {
    await AppTrackingTransparency.requestTrackingAuthorization();
    await UnityAds.setPrivacyConsent(PrivacyConsentType.gdpr, true);
    await UnityAds.setPrivacyConsent(PrivacyConsentType.ageGate, true);
    await UnityAds.setPrivacyConsent(PrivacyConsentType.ccpa, true);
    await UnityAds.setPrivacyConsent(PrivacyConsentType.pipl, true);

    Future.delayed(const Duration(milliseconds: 1000), () {
      UnityAds.init(
        gameId: Platform.isAndroid ? ANDROID_ADS_ID : IOS_ADS_ID,
        onComplete: () => print('Initialization UnityAds Success'),
        onFailed: (error, message) =>
            print('Initialization UnityAds Failed: $error $message'),
        testMode: IS_TEST,
      );
    });
  }
mhanzla80 commented 1 year ago

@afu-hive wouldn't it be like this?

TrackingStatus status = await AppTrackingTransparency.trackingAuthorizationStatus;
      if (status == TrackingStatus.notDetermined) {
        status = await AppTrackingTransparency.requestTrackingAuthorization();
      }

      await UnityAds.setPrivacyConsent(PrivacyConsentType.gdpr, status == TrackingStatus.authorized);
      await UnityAds.setPrivacyConsent(PrivacyConsentType.ageGate, status == TrackingStatus.authorized);
      await UnityAds.setPrivacyConsent(PrivacyConsentType.ccpa, status == TrackingStatus.authorized);
      await UnityAds.setPrivacyConsent(PrivacyConsentType.pipl, status == TrackingStatus.authorized);