react-native-appsflyer
Advanced tools
Comparing version 5.4.40 to 6.0.20
@@ -36,3 +36,3 @@ --- | ||
โน Please replace these two lines with what you expected to happen. | ||
e.g. Event to be tracked | ||
e.g. Event to be logged | ||
@@ -39,0 +39,0 @@ ## What happened instead? |
# Versions | ||
## 6.0.20 | ||
- iOS SDK 6.0.2 | ||
_APIs renamed:_ | ||
| Old API | New API | | ||
| ------------------------------|-------------------------------| | ||
| trackEvent | logEvent | | ||
| trackLocation | logLocation | | ||
| stopTracking | stop | | ||
| trackCrossPromotionImpression | logCrossPromotionImpression | | ||
| trackAndOpenStore | logCrossPromotionAndOpenStore | | ||
| setDeviceTrackingDisabled | anonymizeUser | | ||
| disableAdvertiserIdentifier | disableAdvertisingIdentifier | | ||
_APIs removed:_ | ||
- trackAppLaunch | ||
- enableUninstallTracking | ||
- sendDeepLinkData | ||
## 5.4.40 | ||
@@ -4,0 +28,0 @@ - Android SDK v5.4.3 |
@@ -7,10 +7,9 @@ # API | ||
- [onAppOpenAttribution](#onAppOpenAttribution) | ||
- [trackEvent](#trackEvent) | ||
- [logEvent](#logEvent) | ||
- [setCustomerUserId](#setCustomerUserId) | ||
- [getAppsFlyerUID](#getAppsFlyerUID) | ||
- [stopTracking](#stopTracking) | ||
- [trackLocation](#trackLocation) | ||
- [stop](#stop) | ||
- [logLocation](#logLocation) | ||
- [setUserEmails](#setUserEmails) | ||
- [setAdditionalData](#setAdditionalData) | ||
- [sendDeepLinkData](#sendDeepLinkData) | ||
- [setAdditionalData](#setAdditionalData) | ||
- [updateServerUninstallToken](#updateServerUninstallToken) | ||
@@ -21,6 +20,6 @@ - [setCollectIMEI](#setCollectIMEI) | ||
- [generateInviteLink](#generateInviteLink) | ||
- [trackCrossPromotionImpression](#trackCrossPromotionImpression) | ||
- [trackAndOpenStore](#trackAndOpenStore) | ||
- [logCrossPromotionImpression](#logCrossPromotionImpression) | ||
- [logCrossPromotionAndOpenStore](#logCrossPromotionAndOpenStore) | ||
- [setCurrencyCode](#setCurrencyCode) | ||
- [setDeviceTrackingDisabled](#setDeviceTrackingDisabled) | ||
- [anonymizeUser](#anonymizeUser) | ||
- [setOneLinkCustomDomains](#setOneLinkCustomDomains) | ||
@@ -32,3 +31,3 @@ - [setResolveDeepLinkURLs](#setResolveDeepLinkURLs) | ||
- [disableCollectASA](#disableCollectASA) | ||
- [disableAdvertiserIdentifier](#disableAdvertiserIdentifier) | ||
- [disableAdvertisingIdentifier](#disableAdvertisingIdentifier) | ||
@@ -188,3 +187,3 @@ --- | ||
##### <a id="trackEvent"> **`trackEvent(eventName, eventValues, success, error)`** | ||
##### <a id="logEvent"> **`logEvent(eventName, eventValues, success, error)`** | ||
@@ -214,3 +213,3 @@ In-App Events provide insight on what is happening in your app. It is recommended to take the time and define the events you want to measure to allow you to measure ROI (Return on Investment) and LTV (Lifetime Value). | ||
appsFlyer.trackEvent( | ||
appsFlyer.logEvent( | ||
eventName, | ||
@@ -274,3 +273,3 @@ eventValues, | ||
##### <a id="stopTracking"> **`stopTracking(isStopTracking, callback)`** | ||
##### <a id="stop"> **`stop(isStopped, callback)`** | ||
@@ -285,3 +284,3 @@ In some extreme cases you might want to shut down all SDK functions due to legal and privacy compliance. This can be achieved with the stopSDK API. Once this API is invoked, our SDK no longer communicates with our servers and stops functioning. | ||
| ---------- |----------|------------------ | | ||
| isStopTracking | boolean | True if the SDK is stopped (default value is false). | | ||
| isStopped | boolean | True if the SDK is stopped (default value is false). | | ||
| callback | function | success callback | | ||
@@ -293,3 +292,3 @@ | ||
```javascript | ||
appsFlyer.stopTracking(true, (res) => { | ||
appsFlyer.stop(true, (res) => { | ||
//... | ||
@@ -301,3 +300,3 @@ }); | ||
##### <a id="trackLocation"> **`trackLocation(longitude, latitude, callback)`** | ||
##### <a id="logLocation"> **`logLocation(longitude, latitude, callback)`** | ||
@@ -319,3 +318,3 @@ Manually record the location of the user. | ||
appsFlyer.trackLocation(longitude, latitude, (err, coords) => { | ||
appsFlyer.logLocation(longitude, latitude, (err, coords) => { | ||
if (err) { | ||
@@ -396,33 +395,2 @@ console.error(err); | ||
##### <a id="sendDeepLinkData"> **`sendDeepLinkData(callback)`** | ||
(Android only) | ||
Report Deep Links for Re-Targeting Attribution (Android). This method should be called when an app is opened using a deep link. | ||
| parameter | type | description | | ||
| ---------- |----------|------------------ | | ||
| callback | function | success callback | | ||
*Example:* | ||
```javascript | ||
componentDidMount() { | ||
Linking.getInitialURL() | ||
.then((url) => { | ||
if (appsFlyer) { | ||
appsFlyer.sendDeepLinkData(url); // Report Deep Link to AppsFlyer | ||
// Additional Deep Link Logic Here ... | ||
} | ||
}) | ||
.catch((err) => console.error('An error occurred', err)); | ||
} | ||
``` | ||
More about Deep Links in React-Native: [React-Native Linking](https://facebook.github.io/react-native/docs/linking.html).<br/> | ||
More about Deep Links in Android: [Android Deep Linking , Adding Filters](https://developer.android.com/training/app-indexing/deep-linking.html#adding-filters). | ||
--- | ||
##### <a id="updateServerUninstallToken"> **`updateServerUninstallToken(token, callback)`** | ||
@@ -556,3 +524,3 @@ | ||
##### <a id="trackCrossPromotionImpression"> **`trackCrossPromotionImpression(appId, campaign)`** | ||
##### <a id="logCrossPromotionImpression"> **`logCrossPromotionImpression(appId, campaign)`** | ||
@@ -572,10 +540,10 @@ To attribute an impression use the following API call.<br/> | ||
```javascript | ||
appsFlyer.trackCrossPromotionImpression("com.myandroid.app", "myCampaign"); | ||
appsFlyer.logCrossPromotionImpression("com.myandroid.app", "myCampaign"); | ||
``` | ||
For more details about Cross-Promotion tracking please see the relevent doc [here](https://support.appsflyer.com/hc/en-us/articles/115004481946-Cross-Promotion-Tracking). | ||
For more details about Cross-Promotion logging please see the relevent doc [here](https://support.appsflyer.com/hc/en-us/articles/115004481946-Cross-Promotion-Tracking). | ||
--- | ||
##### <a id="trackAndOpenStore"> **`trackAndOpenStore(appId, campaign, params)`** | ||
##### <a id="logCrossPromotionAndOpenStore"> **`logCrossPromotionAndOpenStore(appId, campaign, params)`** | ||
@@ -599,3 +567,3 @@ Use the following API to attribute the click and launch the app store's app page. | ||
appsFlyer.trackAndOpenStore( | ||
appsFlyer.logCrossPromotionAndOpenStore( | ||
'com.myandroid.app', | ||
@@ -629,3 +597,3 @@ 'myCampaign', | ||
##### <a id="setDeviceTrackingDisabled"> **`setDeviceTrackingDisabled(isDeviceTrackingDisabled, callback)`** | ||
##### <a id="anonymizeUser"> **`anonymizeUser(shouldAnonymize, callback)`** | ||
@@ -638,3 +606,3 @@ It is possible to anonymize specific user identifiers within AppsFlyer analytics.<br/> | ||
| ---------- |----------|------------------ | | ||
| isDeviceTrackingDisabled | boolean | True if want Anonymize user Data (default value is false). | | ||
| shouldAnonymize | boolean | True if want Anonymize user Data (default value is false). | | ||
| callback | function | success callback | | ||
@@ -646,3 +614,3 @@ | ||
```javascript | ||
appsFlyer.setDeviceTrackingDisabled(true, () => {}); | ||
appsFlyer.anonymizeUser(true, () => {}); | ||
``` | ||
@@ -773,3 +741,3 @@ | ||
##### <a id="disableAdvertiserIdentifier"> **`disableAdvertiserIdentifier(shouldDisable)`** | ||
##### <a id="disableAdvertisingIdentifier"> **`disableAdvertisingIdentifier(shouldDisable)`** | ||
@@ -787,5 +755,5 @@ (iOS only) | ||
```javascript | ||
appsFlyer.disableAdvertiserIdentifier(true); | ||
appsFlyer.disableAdvertisingIdentifier(true); | ||
``` | ||
--- |
@@ -13,5 +13,5 @@ # React Native Appsflyer Plugin Guides | ||
- [Android Deeplink Setup](#android-deeplinks) | ||
- [Uninstall](#track-app-uninstalls) | ||
- [iOS Uninstall Setup](#track-app-uninstalls-ios) | ||
- [Android Uninstall Setup](#track-app-uninstalls-android) | ||
- [Uninstall](#measure-app-uninstalls) | ||
- [iOS Uninstall Setup](#measure-app-uninstalls-ios) | ||
- [Android Uninstall Setup](#measure-app-uninstalls-android) | ||
@@ -240,3 +240,3 @@ | ||
In order to track retargeting and use the onAppOpenAttribution callbacks in iOS, the developer needs to pass the User Activity / URL to our SDK, via the following methods in the **AppDelegate.m** file: | ||
In order to record retargeting and use the onAppOpenAttribution callbacks in iOS, the developer needs to pass the User Activity / URL to our SDK, via the following methods in the **AppDelegate.m** file: | ||
@@ -246,6 +246,6 @@ #### import | ||
#import <React/RCTLinkingManager.h> | ||
#if __has_include(<AppsFlyerLib/AppsFlyerTracker.h>) // from Pod | ||
#import <AppsFlyerLib/AppsFlyerTracker.h> | ||
#if __has_include(<AppsFlyerLib/AppsFlyerLib.h>) // from Pod | ||
#import <AppsFlyerLib/AppsFlyerLib.h> | ||
#else | ||
#import "AppsFlyerTracker.h" | ||
#import "AppsFlyerLib.h" | ||
#endif | ||
@@ -257,3 +257,3 @@ ``` | ||
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler { | ||
[[AppsFlyerTracker sharedTracker] continueUserActivity:userActivity restorationHandler:restorationHandler]; | ||
[[AppsFlyerLib shared] continueUserActivity:userActivity restorationHandler:restorationHandler]; | ||
return YES; | ||
@@ -267,3 +267,3 @@ } | ||
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation { | ||
[[AppsFlyerTracker sharedTracker] handleOpenURL:url sourceApplication:sourceApplication withAnnotation:annotation]; | ||
[[AppsFlyerLib shared] handleOpenURL:url sourceApplication:sourceApplication withAnnotation:annotation]; | ||
return YES; | ||
@@ -275,3 +275,3 @@ } | ||
options:(NSDictionary *) options { | ||
[[AppsFlyerTracker sharedTracker] handleOpenUrl:url options:options]; | ||
[[AppsFlyerLib shared] handleOpenUrl:url options:options]; | ||
return YES; | ||
@@ -303,9 +303,9 @@ } | ||
### <a id="track-app-uninstalls"> Track App Uninstalls | ||
### <a id="measure-app-uninstalls"> Measure App Uninstalls | ||
#### <a id="track-app-uninstalls-ios"> iOS | ||
#### <a id="measure-app-uninstalls-ios"> iOS | ||
#### First method | ||
AppsFlyer enables you to track app uninstalls. To handle notifications it requires to modify your `AppDelegate.m`. Use [didRegisterForRemoteNotificationsWithDeviceToken](https://developer.apple.com/reference/uikit/uiapplicationdelegate) to register to the uninstall feature. | ||
AppsFlyer enables you to measure app uninstalls. To handle notifications it requires to modify your `AppDelegate.m`. Use [didRegisterForRemoteNotificationsWithDeviceToken](https://developer.apple.com/reference/uikit/uiapplicationdelegate) to register to the uninstall feature. | ||
@@ -320,4 +320,4 @@ *Example:* | ||
- (void)application:(UIApplication โ*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *โ)deviceToken { | ||
// notify AppsFlyerTracker | ||
[[AppsFlyerTracker sharedTracker] registerUninstall:deviceToken]; | ||
// notify AppsFlyerLib | ||
[[AppsFlyerLib shared] registerUninstall:deviceToken]; | ||
} | ||
@@ -340,3 +340,3 @@ ``` | ||
#### <a id="track-app-uninstalls-android"> Android | ||
#### <a id="measure-app-uninstalls-android"> Android | ||
@@ -353,3 +353,3 @@ Update Firebase device token so it can be sent to AppsFlyer | ||
Read more about Android Uninstall Tracking: [Appsflyer SDK support site](https://support.appsflyer.com/hc/en-us/articles/208004986-Android-Uninstall-Tracking) | ||
Read more about Android Uninstall Measurement: [Appsflyer SDK support site](https://support.appsflyer.com/hc/en-us/articles/208004986-Android-Uninstall-Tracking) | ||
@@ -32,4 +32,5 @@ /** | ||
devKey:string; | ||
appId?:string; //for iOS | ||
appId?:string; // iOS only | ||
isDebug?:boolean; | ||
timeToWaitForAdvertiserID?:number; // iOS only | ||
} | ||
@@ -55,15 +56,15 @@ | ||
initSdk(options:InitSDKOptions, successC?:SuccessCB, errorC?:ErrorCB): Response<string> | ||
trackEvent(eventName:string, eventValues:object, successC?:SuccessCB, errorC?:ErrorCB): Response<string> | ||
setUserEmails(options:SetEmailsOptions, successC?:SuccessCB, errorC?:ErrorCB): void | ||
initSdk(options: InitSDKOptions, successC?: SuccessCB, errorC?: ErrorCB): Response<string> | ||
logEvent(eventName: string, eventValues: object, successC?: SuccessCB, errorC?: ErrorCB): Response<string> | ||
setUserEmails(options: SetEmailsOptions, successC?: SuccessCB, errorC?: ErrorCB): void | ||
setAdditionalData(additionalData: object, successC?: SuccessCB): void | ||
getAppsFlyerUID(callback: (error: Error, uid: string) => any): void | ||
setCustomerUserId(userId: string, successC?: SuccessCB): void | ||
stopTracking(isStopTracking: boolean, successC?: SuccessCB): void | ||
stop(isStopped: boolean, successC?: SuccessCB): void | ||
setAppInviteOneLinkID(oneLinkID: string, successC?: SuccessCB): void | ||
generateInviteLink(params: GenerateInviteLinkParams, successC?: SuccessCB, errorC?: ErrorCB): void | ||
trackCrossPromotionImpression(appId: string, campaign: string): void | ||
trackAndOpenStore(appId: string, campaign: string, params: object): void | ||
logCrossPromotionImpression(appId: string, campaign: string, parameters: object): void | ||
logCrossPromotionAndOpenStore(appId: string, campaign: string, params: object): void | ||
setCurrencyCode(currencyCode: string, successC: SuccessCB): void | ||
setDeviceTrackingDisabled(isDeviceTrackingDisabled: boolean, successC: SuccessCB): void | ||
anonymizeUser(shouldAnonymize: boolean, successC: SuccessCB): void | ||
setOneLinkCustomDomains(domains: string[], successC?: SuccessCB, errorC?: ErrorCB): void | ||
@@ -74,2 +75,3 @@ setResolveDeepLinkURLs(urls: string[], successC?: SuccessCB, errorC?: ErrorCB): void | ||
setSharingFilter(partners, successC, errorC): void | ||
logLocation(longitude: number, latitude: number, callback: SuccessCB): void | ||
@@ -81,3 +83,3 @@ /** | ||
trackLocation(longitude: number, latitude: number, callback: SuccessCB): void | ||
disableAdvertiserIdentifier(shouldDisable: boolean):void | ||
disableAdvertisingIdentifier(shouldDisable: boolean):void | ||
disableCollectASA(shouldDisable: boolean):void | ||
@@ -88,10 +90,5 @@ | ||
* */ | ||
sendDeepLinkData(callback:any): void | ||
setCollectIMEI(isCollect:boolean, successC?:SuccessCB): void | ||
setCollectAndroidID(isCollect:boolean, successC?:SuccessCB): void | ||
updateServerUninstallToken(token:string, successC?:SuccessCB): void | ||
/** @deprecated - please use updateServerUninstallToken **/ | ||
setGCMProjectNumber(gcmProjectNumber:any, successC?:SuccessCB, errorC?:ErrorCB): void | ||
/** @deprecated - please use updateServerUninstallToken **/ | ||
enableUninstallTracking(gcmProjectNumber:any, successC?:SuccessCB): void | ||
setCollectIMEI(isCollect: boolean, successC?: SuccessCB): void | ||
setCollectAndroidID(isCollect: boolean, successC?: SuccessCB): void | ||
updateServerUninstallToken(token: string, successC?: SuccessCB): void | ||
}; | ||
@@ -98,0 +95,0 @@ |
173
index.js
@@ -20,4 +20,4 @@ import {NativeEventEmitter, NativeModules} from "react-native"; | ||
options.onInstallConversionDataListener = eventsMap["onInstallConversionData"] | ||
? true | ||
: false; | ||
? true | ||
: false; | ||
@@ -34,30 +34,23 @@ if (success && error) { | ||
function trackEventCallback(eventName, eventValues, successC, errorC) { | ||
return RNAppsFlyer.trackEvent(eventName, eventValues, successC, errorC); | ||
function logEventCallback(eventName, eventValues, successC, errorC) { | ||
return RNAppsFlyer.logEvent(eventName, eventValues, successC, errorC); | ||
} | ||
function trackEventPromise(eventName, eventValues): Promise<string> { | ||
return RNAppsFlyer.trackEventWithPromise(eventName, eventValues); | ||
function logEventPromise(eventName, eventValues): Promise<string> { | ||
return RNAppsFlyer.logEventWithPromise(eventName, eventValues); | ||
} | ||
function trackEvent(eventName, eventValues, success, error): Promise<string> { | ||
function logEvent(eventName, eventValues, success, error): Promise<string> { | ||
if (success && error) { | ||
//trackEvent is a callback function | ||
trackEventCallback(eventName, eventValues, success, error); | ||
//logEvent is a callback function | ||
logEventCallback(eventName, eventValues, success, error); | ||
} else if (!success) { | ||
//trackEvent is a promise function | ||
return trackEventPromise(eventName, eventValues); | ||
//logEvent is a promise function | ||
return logEventPromise(eventName, eventValues); | ||
} | ||
} | ||
appsFlyer.trackEvent = trackEvent; | ||
appsFlyer.logEvent = logEvent; | ||
/** | ||
* iOS only | ||
*/ | ||
appsFlyer.trackAppLaunch = () => { | ||
return RNAppsFlyer.trackAppLaunch(); | ||
}; | ||
/** | ||
* Manually record the location of the user | ||
@@ -67,7 +60,6 @@ * | ||
* @param latitude latitude as double. | ||
* @callback callback success callback function. | ||
* @platform ios only | ||
* @param callback success callback function | ||
*/ | ||
appsFlyer.trackLocation = (longitude, latitude, callback) => { | ||
return RNAppsFlyer.trackLocation(longitude, latitude, callback); | ||
appsFlyer.logLocation = (longitude, latitude, callback) => { | ||
return RNAppsFlyer.logLocation(longitude, latitude, callback); | ||
}; | ||
@@ -79,4 +71,4 @@ | ||
* @param options latitude as double. | ||
* @callback successC success callback function. | ||
* @callback errorC error callback function. | ||
* @param successC success callback function. | ||
* @param errorC error callback function. | ||
*/ | ||
@@ -91,3 +83,3 @@ appsFlyer.setUserEmails = (options, successC, errorC) => { | ||
* @param additionalData additional data Dictionary. | ||
* @callback successC success callback function. | ||
* @param successC success callback function. | ||
*/ | ||
@@ -107,25 +99,7 @@ appsFlyer.setAdditionalData = (additionalData, successC) => { | ||
appsFlyer.sendDeepLinkData = callback => { | ||
return RNAppsFlyer.sendDeepLinkData(callback); | ||
}; | ||
/** | ||
* @deprecated | ||
*/ | ||
appsFlyer.setGCMProjectNumber = (gcmProjectNumber, successC, errorC) => { | ||
return RNAppsFlyer.setGCMProjectNumber(gcmProjectNumber, successC, errorC); | ||
}; | ||
/** | ||
* @deprecated | ||
*/ | ||
appsFlyer.enableUninstallTracking = (gcmProjectNumber, successC) => { | ||
return RNAppsFlyer.enableUninstallTracking(gcmProjectNumber, successC); | ||
}; | ||
/** | ||
* Manually pass the Firebase / GCM Device Token for Uninstall measurement. | ||
* | ||
* @param token Firebase Device Token. | ||
* @callback successC success callback function. | ||
* @param successC success callback function. | ||
*/ | ||
@@ -141,3 +115,3 @@ appsFlyer.updateServerUninstallToken = (token, successC) => { | ||
* @param {string} userId Customer ID for client. | ||
* @callback successC success callback function. | ||
* @param successC callback function. | ||
*/ | ||
@@ -151,9 +125,9 @@ appsFlyer.setCustomerUserId = (userId, successC) => { | ||
* In some extreme cases you might want to shut down all SDK activity due to legal and privacy compliance. | ||
* This can be achieved with the stopTracking API. | ||
* This can be achieved with the stop API. | ||
* | ||
* @param {boolean} isStopTracking boolean should SDK be stopped. | ||
* @callback successC success callback function. | ||
* @param {boolean} isStopped boolean should SDK be stopped. | ||
* @param successC callback function. | ||
*/ | ||
appsFlyer.stopTracking = (isStopTracking, successC) => { | ||
return RNAppsFlyer.stopTracking(isStopTracking, successC); | ||
appsFlyer.stop = (isStopped, successC) => { | ||
return RNAppsFlyer.stop(isStopped, successC); | ||
}; | ||
@@ -167,3 +141,3 @@ | ||
* @param {boolean} isCollect boolean, false to opt out. | ||
* @callback successC success callback function. | ||
* @param successC callback function. | ||
* @platform android | ||
@@ -181,3 +155,3 @@ */ | ||
* @param {boolean} isCollect boolean, false to opt out. | ||
* @callback successC success callback function. | ||
* @param successC callback function. | ||
* @platform android | ||
@@ -194,3 +168,3 @@ */ | ||
* @param {string} oneLinkID OneLink ID obtained from the AppsFlyer Dashboard. | ||
* @callback successC success callback function. | ||
* @param successC callback function. | ||
*/ | ||
@@ -206,4 +180,4 @@ appsFlyer.setAppInviteOneLinkID = (oneLinkID, successC) => { | ||
* @param parameters Dictionary. | ||
* @callback success success callback function. | ||
* @callback error error callback function. | ||
* @param success success callback function.. | ||
* @param error error callback function. | ||
*/ | ||
@@ -220,5 +194,6 @@ appsFlyer.generateInviteLink = (parameters, success, error) => { | ||
* @param campaign cross promotion campaign. | ||
* @param parameters additional params to be added to the attribution link | ||
*/ | ||
appsFlyer.trackCrossPromotionImpression = (appId, campaign) => { | ||
return RNAppsFlyer.trackCrossPromotionImpression(appId, campaign); | ||
appsFlyer.logCrossPromotionImpression = (appId, campaign, parameters) => { | ||
return RNAppsFlyer.logCrossPromotionImpression(appId, campaign, parameters); | ||
}; | ||
@@ -233,4 +208,4 @@ | ||
*/ | ||
appsFlyer.trackAndOpenStore = (appId, campaign, params) => { | ||
return RNAppsFlyer.trackAndOpenStore(appId, campaign, params); | ||
appsFlyer.logCrossPromotionAndOpenStore = (appId, campaign, params) => { | ||
return RNAppsFlyer.logCrossPromotionAndOpenStore(appId, campaign, params); | ||
}; | ||
@@ -249,4 +224,2 @@ | ||
/** | ||
@@ -269,18 +242,18 @@ * Accessing AppsFlyer Attribution / Conversion Data from the SDK (Deferred Deeplinking) | ||
const listener = appsFlyerEventEmitter.addListener( | ||
"onInstallConversionDataLoaded", | ||
_data => { | ||
if (callback && typeof callback === typeof Function) { | ||
try { | ||
let data = JSON.parse(_data); | ||
callback(data); | ||
} catch (_error) { | ||
//throw new AFParseJSONException("..."); | ||
//TODO: for today we return an error in callback | ||
callback(new AFParseJSONException("Invalid data structure", _data)); | ||
"onInstallConversionDataLoaded", | ||
_data => { | ||
if (callback && typeof callback === typeof Function) { | ||
try { | ||
let data = JSON.parse(_data); | ||
callback(data); | ||
} catch (_error) { | ||
//throw new AFParseJSONException("..."); | ||
//TODO: for today we return an error in callback | ||
callback(new AFParseJSONException("Invalid data structure", _data)); | ||
} | ||
} | ||
} | ||
} | ||
); | ||
eventsMap["onInstallConversionData"] = listener; | ||
eventsMap["onInstallConversionData"] = listener; | ||
@@ -296,18 +269,18 @@ // unregister listener (suppose should be called from componentWillUnmount() ) | ||
const listener = appsFlyerEventEmitter.addListener( | ||
"onInstallConversionFailure", | ||
_data => { | ||
if (callback && typeof callback === typeof Function) { | ||
try { | ||
let data = JSON.parse(_data); | ||
callback(data); | ||
} catch (_error) { | ||
//throw new AFParseJSONException("..."); | ||
//TODO: for today we return an error in callback | ||
callback(new AFParseJSONException("Invalid data structure", _data)); | ||
"onInstallConversionFailure", | ||
_data => { | ||
if (callback && typeof callback === typeof Function) { | ||
try { | ||
let data = JSON.parse(_data); | ||
callback(data); | ||
} catch (_error) { | ||
//throw new AFParseJSONException("..."); | ||
//TODO: for today we return an error in callback | ||
callback(new AFParseJSONException("Invalid data structure", _data)); | ||
} | ||
} | ||
} | ||
} | ||
); | ||
eventsMap["onInstallConversionFailure"] = listener; | ||
eventsMap["onInstallConversionFailure"] = listener; | ||
@@ -325,13 +298,13 @@ // unregister listener (suppose should be called from componentWillUnmount() ) | ||
const listener = appsFlyerEventEmitter.addListener( | ||
"onAppOpenAttribution", | ||
_data => { | ||
if (callback && typeof callback === typeof Function) { | ||
try { | ||
let data = JSON.parse(_data); | ||
callback(data); | ||
} catch (_error) { | ||
callback(new AFParseJSONException("Invalid data structure", _data)); | ||
"onAppOpenAttribution", | ||
_data => { | ||
if (callback && typeof callback === typeof Function) { | ||
try { | ||
let data = JSON.parse(_data); | ||
callback(data); | ||
} catch (_error) { | ||
callback(new AFParseJSONException("Invalid data structure", _data)); | ||
} | ||
} | ||
} | ||
} | ||
); | ||
@@ -352,7 +325,7 @@ | ||
* Default is false | ||
* @param isDeviceTrackingDisabled boolean | ||
* @param shouldAnonymize boolean | ||
* @param successC success callback function. | ||
*/ | ||
appsFlyer.setDeviceTrackingDisabled = (isDeviceTrackingDisabled, successC) => { | ||
return RNAppsFlyer.setDeviceTrackingDisabled(isDeviceTrackingDisabled, successC); | ||
appsFlyer.anonymizeUser = (shouldAnonymize, successC) => { | ||
return RNAppsFlyer.anonymizeUser(shouldAnonymize, successC); | ||
}; | ||
@@ -424,4 +397,4 @@ | ||
*/ | ||
appsFlyer.disableAdvertiserIdentifier = (shouldDisable) => { | ||
return RNAppsFlyer.disableAdvertiserIdentifier(shouldDisable); | ||
appsFlyer.disableAdvertisingIdentifier = (shouldDisable) => { | ||
return RNAppsFlyer.disableAdvertisingIdentifier(shouldDisable); | ||
} | ||
@@ -428,0 +401,0 @@ |
{ | ||
"name": "react-native-appsflyer", | ||
"version": "5.4.40", | ||
"version": "6.0.20", | ||
"description": "React Native Appsflyer plugin", | ||
"main": "index.js", | ||
"scripts": { | ||
"demo.ios": "cd examples/demo; react-native run-ios", | ||
"demo.android": "cd examples/demo; react-native run-android", | ||
"ios-pod": "cd examples/demo/ios; pod install", | ||
"preparedemo": "cd examples/demo; npm uninstall react-native-appsflyer --save; npm install .. --save", | ||
"demo2.ios": "cd examples/DemoPod2; react-native run-ios", | ||
"demo2.android": "cd examples/DemoPod2; react-native run-android", | ||
"ios-pod2": "cd examples/DemoPod2/ios; pod install", | ||
"preparedemo2": "cd examples/DemoPod2; npm uninstall react-native-appsflyer --save; npm install .. --save", | ||
"setup": "cd examples/demo; npm install; cd ..; npm run preparedemo;", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"demo.ios": "npm run ios-pod; cd SampleApp; react-native run-ios", | ||
"demo.android": "cd SampleApp; react-native run-android", | ||
"ios-pod": "cd SampleApp/ios; pod install; cd ../" | ||
}, | ||
@@ -18,0 +11,0 @@ "repository": { |
<img src="https://www.appsflyer.com/wp-content/uploads/2016/11/logo-1.svg" width="450"> | ||
# React Native AppsFlyer plugin for Android and iOS. | ||
# React Native AppsFlyer plugin for Android and iOS. | ||
@@ -15,2 +15,3 @@ ๐ In order for us to provide optimal support, we would kindly ask you to submit any issues to support@appsflyer.com | ||
- [v6 Breaking changes](#v6-breaking-changes) | ||
- [Adding the SDK to your project](#installation) | ||
@@ -23,8 +24,29 @@ - [Initializing the SDK](#init-sdk) | ||
- iOS AppsFlyerSDK **v5.4.4** | ||
- iOS AppsFlyerSDK **v6.0.2** | ||
- Android AppsFlyerSDK **v5.4.3** | ||
## <a id="v6-breaking-changes"> โ v6 Breaking Changes | ||
We have renamed the following APIs: | ||
| Old API | New API | | ||
| ------------------------------|-------------------------------| | ||
| trackEvent | logEvent | | ||
| trackLocation | logLocation | | ||
| stopTracking | stop | | ||
| trackCrossPromotionImpression | logCrossPromotionImpression | | ||
| trackAndOpenStore | logCrossPromotionAndOpenStore | | ||
| setDeviceTrackingDisabled | anonymizeUser | | ||
And removed the following ones: | ||
- trackAppLaunch -> no longer needed. See new init guide | ||
- sendDeepLinkData -> no longer needed. See new init guide | ||
- enableUninstallTracking -> no longer needed. See new uninstall measurement guide | ||
If you have used 1 of the removed APIs, please check the integration guide for the updated instructions | ||
## <a id="installation"> ๐ฒ Adding the SDK to your project | ||
**Production** version from npm: | ||
``` | ||
@@ -81,4 +103,2 @@ $ npm install react-native-appsflyer --save | ||
**Important** - For iOS another step is required. AppState logic is required to record Background-to-foreground transitions. Check out the [relevant guide](./Docs/API.md#--appsflyertrackapplaunch-void) to see how this mandatory step is implemented. | ||
## <a id="guides"> ๐ Guides | ||
@@ -89,3 +109,3 @@ | ||
- [Deeplinking Guide](/Docs/Guides.md#deeplinking) | ||
- [Uninstall Guide](/Docs/Guides.md#track-app-uninstalls) | ||
- [Uninstall Guide](/Docs/Guides.md#measure-app-uninstalls) | ||
@@ -92,0 +112,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
658307
0
114
443