-
Notifications
You must be signed in to change notification settings - Fork 29
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
Popup not displayed if an other is already shown or in Release #26
Comments
In addition popup seems not appear in production (release mode). I've wrapped my MaterialApp with the following code : import 'dart:io';
import 'package:app_tracking_transparency/app_tracking_transparency.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:visilab/services/logger.dart';
// Should we await for ATT before displaying app ? I notice that it took some times...
class MyAppTrackingTransparency extends StatefulWidget {
final Widget child;
const MyAppTrackingTransparency({final Key? key, required this.child}) : super(key: key);
@override
State<MyAppTrackingTransparency> createState() => _MyAppTrackingTransparency();
}
class _MyAppTrackingTransparency extends State<MyAppTrackingTransparency> {
@override
void initState() {
super.initState();
if (Platform.isIOS) {
// Can't show the dialog in initState, delaying initialization
WidgetsBinding.instance!.addPostFrameCallback((final _) {
initATT();
});
}
}
Future<void> initATT() async {
TrackingStatus status = TrackingStatus.notDetermined;
try {
status = await AppTrackingTransparency.trackingAuthorizationStatus;
//setState(() => _authStatus = '$status');
// If the system can show an authorization request dialog
if (status == TrackingStatus.notDetermined) {
status = await AppTrackingTransparency.requestTrackingAuthorization();
}
} catch (err, stack) {
LoggerCrashlytics.record(exception: err, stack: stack, reason: 'AppTrackingTransparency failed !');
} finally {
//setState(() => ready = true);
}
if (kDebugMode) print(status);
}
@override
Widget build(final BuildContext context) {
return widget.child;
}
}
I need to wrap initATT inside a Future.delayed to let him work in release, in debug popup is well displayed... Seems like I ask ATT 'too fast'... Future<dynamic>.delayed(const Duration(seconds: 2), initATT); Can you provide me some information about why this happen and what is the best way to implement ATT in Flutter app (where ?) :/ |
it happened to me also and it is not showing in release. |
Also happening to me. My app update got rejected on App Store. Need a fix asap. |
I put a Future.delayed(Duration(seconds: 2)); before call ATT. App was approuved, but it is dirty ! |
in my case the permission was showing but they rejecting the app, i solved the problem by changing the privacy of the app , |
My app also got rejected because of that error. I saw that ATTrackingManager has an async function. And I was hoping I could force wait for the function. class func requestTrackingAuthorization() async -> ATTrackingManager.AuthorizationStatus |
AppTrackingTransparency.trackingAuthorizationStatus always return notDetermined if an other popup like notification permissions is visible.
The text was updated successfully, but these errors were encountered: