Skip to content

Instantly share code, notes, and snippets.

@Wizpna
Created November 19, 2023 14:55
Show Gist options
  • Save Wizpna/d407af2ef3286b9006c7991e1d0cf439 to your computer and use it in GitHub Desktop.
Save Wizpna/d407af2ef3286b9006c7991e1d0cf439 to your computer and use it in GitHub Desktop.
A demonstration project illustrating how to implement appflyer in your Flutter project.
//this method initialize App Tracking Transparency Plugin
Future<void> initAppTrackingTransparencyPlugin() async {
// Platform messages may fail, so we use a try/catch PlatformException.
try {
final TrackingStatus status =
await AppTrackingTransparency.trackingAuthorizationStatus;
// If the system can show an authorization request dialog
if (status == TrackingStatus.notDetermined) {
await AppTrackingTransparency.requestTrackingAuthorization();
}
} catch (e) {
if (kDebugMode) {
print("e ${e.toString()}");
}
}
await AppTrackingTransparency.getAdvertisingIdentifier();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment