Created
November 19, 2023 14:55
-
-
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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