-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authorisation popup is not showing in iOS 16.5 #44
Comments
Can you write in formatted text with three back quote? Did you try it?
|
I have the same issue today. Apple reject since it is not working for iOS 16.5, Did you already find out the solution ? |
@luminkhant i was facing this same issue. I added bellow code in appDelegate.swift file and Authorisation default alert showing in iOS 16+
|
hi @Zaveri21 The code you provided is printing current tracking status. Could you please explain what else you did to make it work in your case? Thank you. |
I would like to hear more details too @Zaveri21 how you got this fixed, thanks! |
Hi @deniza & @JariHuomo Happy coding 😀 My app was approved and live in apple store with the help of above code block. this swift code will work for iOS 14 or above version. |
Thanks for the explanation. I want to present further information and recommend a more flutter friendly approach: The applicationDidBecomeActive function in iOS is called when your app is brought to the foreground. This can happen when the user taps on your app icon, or the app moved from inactive to active state. Showing a native dialog in iOS will result in the application switching to the inactive state. This is because the dialog will take focus away from your app, and the system will need to pause your app's execution until the dialog is dismissed. You can not display ATT dialog when the application is in inactive state. I suspect that your application somehow become inactive during the call to requestTrackingAuthorization function and hence does not work properly. The most common reason for this to happen is that you request some other permission like notification permission, or camera usage permission that also shows a native dialog and sends your app to inactive state. You can always check that your application is in an active state before calling requestTrackingAuthorization function. In your stateful widget, override didChangeAppLifecycleState function like this:
Below approach is better than calling ATT in a delayed Future call, or in a loop as suggested by other fellow developers. Also you stay in the dart side instead of native code, which may be more preferable. Please try it if you have any issues and respond this thread if it's working or not working in your use case. |
Hi @luminkhant My app is also got approved. i used an extra dialog, before showing the actual Authorization dialog.
|
The problem seems on Apple. They rejected my app update with the same reason. But when i installed ios 16.5 on an iPhone and work it, I saw that permission was requested. Somehow i think there is a problem during the review. I sent the screen recording of the application and explained that the request came to the screen as soon as the application was opened and this time they approved it. I think there is no problem with the package. |
我的项目是Flutter创建的,iOS端语言使用的是OC,针对该问题我的解决方案如下: |
where i have to access package from app_tracking_transparency ? |
HI all, i am facing this issue on IOS 16.6, unable to see the ATT prompt on ios 16.6 whereas it is coming in previous versions. any solution for it, please guide, thanks, |
is there package that i have modified ? i want to try it to modify support iOS 16.6 |
Has anyone found a workaround for this package to work with iOS 16.6 ? Apple keep rejecting now. |
Hi. I tested the package both on ios 16.5 and 16.6 and it seems working fine for me. Please try to call it delayed in a Future.delayed callback, or use an explainer dialog before showing native ATT dialog. |
Same issue. Now I changed this plugin to permission_handler. I hope they will approve it. Btw if you want to crate fix for this plugin you can compare this two files (I know, the second one is not Swift): |
This plugin, or any of the att plugins out there do nothing fancy actually. We just check and return ATT status with one function call; ATTrackingManager.trackingAuthorizationStatus, and show ATT dialog by using another api call; ATTrackingManager.requestTrackingAuthorization. Other then some cosmetic differences both of the implementations are the same; just a basic wrapper around native functionality. |
Thank you for your quick reply @deniza! I missed that example with description: https://github.com/deniza/app_tracking_transparency/blob/a072384e2299ad3021aab2ca5e6031a7bf40079e/example/lib/main.dart#L31C3-L31C89 |
I think the request dialog is not reopen when user reject this auth |
Hey @deniza thanks for your work and the active contributions. What is your suggested approach of resolving this issue occuring? |
Hi there I encounter the similar problem. App rejected by Apple Anyway, here is the code I use My main widget is a InitState method
_requestAppTracking method
build method
_initApp method
I finally could get my hands on a device with 17.3 installed and indeed the AppTrackingPopup does not show during the startup. What is even weirder is that the app navigates to the "home" screen (as stated in the listen section in build()). This only happens if the I am a bit lost here. |
@G4SD3O
|
It works on the simulator with iOS 17.2 and the release note for iOS 17.3 does not indicate major change in this area so this is very weird. |
To expedite the troubleshooting process, I'd like to suggest testing the plugin with a simplified test code. This is often helpful in isolating potential conflicts or integration issues within your larger app's codebase. Can you please test the plugin in such a test environment? |
I have created a simple project to reproduce the issue. Here are my first results:
I still need to find a real phone with iOS 17.3 as the latest Xcode version does not allow me to test this version. Does anyone know an online service (free or very cheap) we can use to do further testing? |
Hi Team,
i am using the latest version of ATT in my flutter app when i published my app to app store they rejected saying:
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.5.
Method:
Future<void> initPlugin() async { // Platform messages may fail, so we use a try/catch PlatformException. try { final TrackingStatus status = await AppTrackingTransparency.trackingAuthorizationStatus; setState(() => _authStatus = '$status'); // If the system can show an authorization request dialog if (status == TrackingStatus.notDetermined) { final TrackingStatus status = await AppTrackingTransparency.requestTrackingAuthorization(); setState(() => _authStatus = '$status'); if (status == TrackingStatus.authorized && defaultTargetPlatform == TargetPlatform.iOS) { _webViewController!.evaluateJavascript( source: 'document.getElementById("onetrust-accept-btn-handler").click()', ); } } } on PlatformException { setState(() => _authStatus = 'PlatformException was thrown'); } final uuid = await AppTrackingTransparency.getAdvertisingIdentifier(); if (kDebugMode) { print("UUID: $uuid"); }
Calling:
void initState() { super.initState(); WidgetsBinding.instance.addPostFrameCallback((_) => initPlugin()); }
The text was updated successfully, but these errors were encountered: