Skip to content

Latest commit

 

History

History
123 lines (91 loc) · 3.5 KB

AdvancedAPI.md

File metadata and controls

123 lines (91 loc) · 3.5 KB

📑 Advanced APIs


iOS

First method

AppsFlyer enables you to measure app uninstalls. To handle notifications it requires to modify your AppDelegate.m. Use didRegisterForRemoteNotificationsWithDeviceToken to register to the uninstall feature.

Example:

@import AppsFlyerLib;

...

- (void)application:(UIApplication ​*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *​)deviceToken {
// notify AppsFlyerLib
 [[AppsFlyerLib shared] registerUninstall:deviceToken];
}

Read more about Uninstall register: Appsflyer SDK support site

Second method

Pass the device token to AppsFlyer

Example:

appsFlyer.updateServerUninstallToken(deviceToken, (success) => {
  //...
});

Update Firebase device token so it can be sent to AppsFlyer

Example:

appsFlyer.updateServerUninstallToken(newFirebaseToken, (success) => {
  //...
});

Read more about Android Uninstall Measurement: Appsflyer SDK support site


A complete list of supported parameters is available here. Custom parameters can be passed using a userParams{} nested object, as in the example above.

parameter type description
parameters json parameters for Invite link
success function success callback (generated link)
error function error callback

Example:

appsFlyer.generateInviteLink(
 {
   channel: 'gmail',
   campaign: 'myCampaign',
   customerID: '1234',
   userParams: {
     myParam: 'newUser',
     anotherParam: 'fromWeb',
     amount: 1,
   },
 },
 (link) => {
   console.log(link);
 },
 (err) => {
   console.log(err);
 }
);

Receipt validation is a secure mechanism whereby the payment platform (e.g. Apple or Google) validates that an in-app purchase indeed occurred as reported.
Learn more - https://support.appsflyer.com/hc/en-us/articles/207032106-Receipt-validation-for-in-app-purchases
❗Important❗ for iOS - set SandBox to true
appsFlyer.setUseReceiptValidationSandbox(true);

parameter type description
purchaseInfo json In-App Purchase parameters
successC function success callback (generated link)
errorC function error callback

Example:

let info = {
        publicKey: 'key',
        currency: 'biz',
        signature: 'sig',
        purchaseData: 'data',
        price: '123',
        productIdentifier: 'identifier',
        currency: 'USD',
        transactionId: '1000000614252747',
        additionalParameters: {'foo': 'bar'},
    };

appsFlyer.validateAndLogInAppPurchase(info, res => console.log(res), err => console.log(err));