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 in iOS 16 #40

Closed noorulamin1 closed 1 year ago

noorulamin1 commented 1 year ago

My app got rejected as in iOS 16 they could not find permissions. When I tried on iOS 16 I could not find any popups for transparency permission here is an issue from the apple resolution center. 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 unable to locate the App Tracking Transparency permission request when reviewed on iOS 16.3.1.

beforeold commented 1 year ago

same issue on iOS 16.4.1 in my project (native code)

nicks258 commented 1 year ago

Any update on this? Facing same rejection. @deniza

noorulamin1 commented 1 year ago

@nicks258 I solved using this directly instead of initPlugin() in initState() WidgetsFlutterBinding.ensureInitialized().addPostFrameCallback( (_) => AppTrackingTransparency.requestTrackingAuthorization());

..Hope it will work for you too. If not please let me know.

deniza commented 1 year ago

Using a post frame callback to call platform channel functions (native code) can be a better approach to avoid potential issues that can occur when calling these functions directly from initState. I will update my example usage to guide people to use this method instead. Thank you for the feedback @noorulamin1

Another viable alternative is to call the initPlugin() function inside the didChangeDependencies() function.