Referensi API
initSDK
- AppsFlyer Dev Key - Obtain the Dev Key from the AppsFlyer Dashboard in the App Settings section.
- Apple App ID - Obtain the app ID from the iTunes store (without the
id
awalan) - Is debug - Once this is enabled the AppsFlyer SDK can log all Installs and Sessions.
- Currency Code (only iOS) - Set the app currency.
- Disable SKAdNetwork (Only iOS) - Disable SKAdNetwork sessions.
- Automatically start the AppsFlyer SDK - When set to
true
, the SDK sends the session automatically (before Blueprint events). When set tofalse
, it's the developer's responsibility to call the start API from the Blueprint.
Start
- Starts the SDK by sending the session to the server.
- By default, the
start
method is called automatically once the app is being launched. - If needed, this setting can be disabled in the Plugin settings, and the developer can call the
start
method under the blueprint. When doing so, the SDK will send a session on every background-foreground transition.
Log Event
The logEvent
method allows you to send in-app events to AppsFlyer.
For more on in-app events check out the AppsFlyer Knowledge base here.
Get AppsFlyerUID
To receive unique AppsFlyer ID per app installation you can use this blueprint:
Set Custom User ID
Setting your own Custom ID enables you to cross-reference your own unique ID with AppsFlyer’s user ID and the other devices’ IDs. This ID is available in AppsFlyer CSV reports along with postback APIs for cross-referencing with your internal IDs.
IMPORTANT: To set the user ID in the first SDK session, please perform the following:
-
Set the
Automatically start the AppsFlyer SDK
flag under the plugin setting to false. -
Panggil
Set Custom User ID
API before the call to theStart
API under the Blueprint:
Uninstall
AppsFlyer uses silent push notifications, once a day, to verify if an app is still installed on a given device. If there is no response, an uninstall is recorded, and attributed to the media source that originally brought the user.
First, make sure to read the relevant information about the uninstall feature in the AppsFlyer dashboard
iOS Uninstall
Penting!
-
To support remote notifications in iOS follow the official unreal docs.
Don't forget to download, compile, and run the Unreal Engine from the source.
-
After Unreal Engine is running, open the Unreal IDE, go to settings > platforms -> iOS, and check Enable Remote Notification Support.
-
Under the setting -> Maps & Mods -> Game instance -> change the instance class to
PlatformGameInstance
-
Configure the nodes under the relevant blueprint:
- Register for remote notification Will show a pop-up to the user from the OS, asking permission for remote notification
- The application registered for remote notifications delegate call AppsFlyer uninstall API from iOS lifecycle
- AppsFlyerSDK remote notification token call AppsFlyer API for sending the token.
-
When debugging, enable AppsFlyer debug logs and check for the Register endpoint
Android Uninstall
Complete the steps in the following article
-
Configure Firebase cloud messaging
-
Follow the app integration steps in this article.
-
Gunakan
appsFlyer.FirebaseMessagingServiceListener
service, embedded in the SDK. This service extends theFirebaseFirebaseMessagingService
class, used for receiving the FCM Device Token:<application <!-- ... --> <service android:name="com.appsflyer.FirebaseMessagingServiceListener"> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT"/> </intent-filter> </service> <!-- ... --> </application>
-
The same nodes as in iOS could be used for Android under the relevant blueprint. No API call is needed.
Set Additional Data
Add custom key-value pairs to the payload of any in-app event, installs included. The values will appear in raw-data reports.
IMPORTANT To include the additional data in the first SDK session, peform the following:
-
Set the Automatically start the AppsFlyer SDK under the plugin setting to false.
-
Panggil
setAdditionalData
API before the call to theStart
API:
Diperbarui 12 bulan yang lalu