deniza / app_tracking_transparency

A Flutter plugin to show ios 14+ tracking authorization dialog.
https://pub.dev/packages/app_tracking_transparency/
MIT License
83 stars 28 forks source link

App Tracking Transparency Issue for iOS 16.5 #43

Closed michaelsof47 closed 1 year ago

michaelsof47 commented 1 year ago

Hello, sir. I have an issue for App Tracking Transparency version 2.0.4.

i have an message from apple such like this before i have updated from 2.0.4 :

" Hello,

The issues we previously identified still need your attention.

If you have any questions, we are here to help. Reply to this message in App Store Connect and let us know.

Guideline 2.1 - Information Needed

We're looking forward to completing our review, but we need more information to continue. Your app uses the AppTrackingTransparency framework, but we are still unable to locate the App Tracking Transparency permission request when reviewed on iOS 16.5.

Next Steps

Please explain where we can find the App Tracking Transparency permission request in your app. The request should appear before any data is collected that could be used to track the user.

If you've implemented App Tracking Transparency but the permission request is not appearing on devices running the latest OS, please review the available documentation and confirm App Tracking Transparency has been correctly implemented.

If your app does not track users, update your app privacy information in App Store Connect to not declare tracking. You must have the Account Holder or Admin role to update app privacy information. "

After, i have updated this dependency and also give an explain about test in our device (especially iOS 16.2) because we didn't have it into apple team. they have message such like this :

" Hello,

Thank you for your message.

It would be appropriate to refer to the available documentation to confirm App Tracking Transparency has been correctly implemented.

In particular, review the specifications for the requestTrackingAuthorization(completionHandler:) type method, make any necessary adjustments, and test your app on a device running the latest version of iOS.

You may also ask a question on the Apple Developer Forums to consult with fellow developers and Apple engineers.

If you need code-level support, your questions would be best addressed by Apple Developer Technical Support who can provide discrete code-level assistance for Apple frameworks, APIs, and tools. You may contact them directly by filing a Technical Support Incident.

We look forward to reviewing your app once the appropriate changes have been made. "

so, any solution about this issue because i don't know how to modify this dependency into my xcode ?

Row7 commented 1 year ago

They recently sent me the same message. I have tested on virtual devices and updated my own device to iOS 16.5 and the ATT dialog does not appear.

iOS 16.5 is a week old so is very recent. It is possible that the package needs some changes to adapt to this new version. Regards,

michaelsof47 commented 1 year ago

i see. Anyway, Is their option that help me to modify it in App Tracking Transparency ?

deniza commented 1 year ago

I have tested the library on an iOS 16.5 device and it is working as expected. Please note the value of AppTrackingTransparency.trackingAuthorizationStatus. Also, remember to remove your app from the device between tests because the ATT dialog cannot be shown a second time. Additionally, it is not possible to show more than one native dialog at a time if you are requesting notification permission or any other kind of native dialog.

michaelsof47 commented 1 year ago

how do you do that ? @deniza. i have configure by this "AppTrackingTransparency.requestTrackingAuthorization()". but, the function of AppTrackingTransparency.trackingAuthorizationStatus was commented it to help worked well

icodelifee commented 1 year ago

Im having the same issue, not sure how to fix it. Its working fine in my phone but not in the reviewers device

Row7 commented 1 year ago

I am using the following line to get the ATT consent dialog and works correctly on the emulator (16.4) and on real device (16.5) with release version --release build.

TrackingStatus status = await AppTrackingTransparency.requestTrackingAuthorization();

I send the app to TestFlight to test it on my device and different things happen depending on where I open it from: If I open the app from within TestFlight app, the ATT dialog does not appear. On the other hand, if I send TestFlight to background and I open the app from the 'app desktop' it works fine and the ATT dialog appears.

Could it be that they are missing something to update or that the same problem occurs when the app is checked by the review team?

They responded with this:

Hello,

Thank you for your response.

We are unable to provide information regarding our review environment.

All apps submitted to the App Store must function correctly and provide access to all features and content at the time of review, regardless of network, device capability, location, etc.

Please refer to our previous messages for information about the issues we encountered during our initial review.

We look forward to reviewing your revised app.

Best regards,

App Store Review

aoizoijoizj commented 1 year ago

I faced the same issue, the dialog doesn't showing I created a function and it worked.

Future<void> requestTrackingAuthorization() async {
  // Request tracking authorization and wait for the result
  if (!Platform.isIOS && !Platform.isMacOS) return;
  TrackingStatus status =
      await AppTrackingTransparency.trackingAuthorizationStatus;
  if (status == TrackingStatus.notDetermined) {
    status = await AppTrackingTransparency.requestTrackingAuthorization();
  }
  if (status == TrackingStatus.notDetermined) {
    await Future.delayed(const Duration(seconds: 1));
    status = await AppTrackingTransparency.requestTrackingAuthorization();
  }
  if (status == TrackingStatus.notDetermined) {
    await Future.delayed(const Duration(seconds: 1));
    status = await AppTrackingTransparency.requestTrackingAuthorization();
  }
}

And if you want to use it like this: await requestTrackingAuthorization(); And it's better to save the value in a storage like "Hive", so you don't run it again.

deniza commented 1 year ago

According to the official Apple documentation, the App Tracking Transparency (ATT) API will only prompt for authorization when the application state is UIApplicationStateActive. If another permission request is pending user confirmation, the authorization prompt will not display. iOS does not preserve concurrent requests, and calls to the ATT API through an app extension will not prompt.

If you are also requesting another permission, such as location permission or push notification permission, the ATT authorization prompt may not display. In this case, you can create an information popup prior to requesting the ATT authorization. When the user closes the popup, you can request for authorization. This will ensure that the application state is UIApplicationStateActive when the ATT authorization prompt is displayed.

I always recommend displaying an "Explainer Dialog" before popping native ATT dialog.

Row7 commented 1 year ago

In my case I only use the ATT dialog before initializing Admob. Thank you @aoizoijoizj! The code worked for me and Apple approved the update 👍

aoizoijoizj commented 1 year ago

@Row7 You're welcome! Yes me too.

michaelsof47 commented 1 year ago

I faced the same issue, the dialog doesn't showing I created a function and it worked.

Future<void> requestTrackingAuthorization() async {
  // Request tracking authorization and wait for the result
  if (!Platform.isIOS && !Platform.isMacOS) return;
  TrackingStatus status =
      await AppTrackingTransparency.trackingAuthorizationStatus;
  if (status == TrackingStatus.notDetermined) {
    status = await AppTrackingTransparency.requestTrackingAuthorization();
  }
  if (status == TrackingStatus.notDetermined) {
    await Future.delayed(const Duration(seconds: 1));
    status = await AppTrackingTransparency.requestTrackingAuthorization();
  }
  if (status == TrackingStatus.notDetermined) {
    await Future.delayed(const Duration(seconds: 1));
    status = await AppTrackingTransparency.requestTrackingAuthorization();
  }
}

And if you want to use it like this: await requestTrackingAuthorization(); And it's better to save the value in a storage like "Hive", so you don't run it again.

btw, after i use this. finally, our apps was released at app store. i think it solved now thank you all