Last active
November 19, 2023 18:45
-
-
Save Wizpna/86be5b9efc8e564b3c92f5bd352797b9 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 function log events to AppFlyer | |
Future<void> logAppFlyerEvent(String eventName, Map eventValues) async { | |
AppsflyerSdk appsflyerSdk = AppsflyerSdk( | |
AppsFlyerOptions( | |
//afDevKey is AppsFlyer Dev key and it's a required parameter | |
afDevKey: "3gnv2x6xnTA5sSXfoMEtcH", | |
//Your apple Id is required for iOS apps and it's a required parameter | |
//To access your Apple ID visit : https://appstoreconnect.apple.com/apps | |
// Click on your app. Create new app if you don't have one. | |
// Then click on App Information at the left side which will open a new window where you will find Apple ID | |
appId: "1234567890", | |
showDebug: kDebugMode, | |
timeToWaitForATTUserAuthorization: 50, | |
disableAdvertisingIdentifier: false, | |
disableCollectASA: false, | |
), | |
); | |
try { | |
await appsflyerSdk.logEvent(eventName, eventValues).then((value) { | |
}); | |
} catch (e) { | |
if (kDebugMode) { | |
print(e.toString()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment