react-native-appsflyer
Advanced tools
Comparing version 6.1.10 to 6.1.20
# Versions | ||
## 6.1.20 | ||
- Unified deep linking | ||
## 6.1.10 | ||
@@ -3,0 +6,0 @@ - iOS SDK 6.1.1 |
@@ -54,3 +54,3 @@ # API | ||
|onInstallConversionDataListener| Set listener for SDK init response (Optional. default=true) | | ||
|onDeepLinkListener| Set listener for DDL response (Optional. default=false) | | ||
*Example:* | ||
@@ -69,2 +69,3 @@ | ||
onInstallConversionDataListener: false, //Optional | ||
onDeepLinkListener: true, //Optional | ||
}, | ||
@@ -71,0 +72,0 @@ (res) => { |
@@ -11,2 +11,3 @@ # React Native Appsflyer Plugin Guides | ||
- [Direct Deep Linking](#direct-deep-linking) | ||
- [Unified deep linking](#Unified-deep-linking) | ||
- [iOS Deeplink Setup](#iosdeeplinks) | ||
@@ -45,8 +46,8 @@ - [Android Deeplink Setup](#android-deeplinks) | ||
#### The 2 Deep Linking Types: | ||
Since users may or may not have the mobile app installed, there are 2 types of deep linking: | ||
#### The 3 Deep Linking Types: | ||
Since users may or may not have the mobile app installed, there are 3 types of deep linking: | ||
1. Deferred Deep Linking - Serving personalized content to new or former users, directly after the installation. | ||
2. Direct Deep Linking - Directly serving personalized content to existing users, which already have the mobile app installed. | ||
3. Unified deep linking - Unified deep linking sends new and existing users to a specific in-app activity as soon as the app is opened.<br> | ||
For more info please check out the [OneLinkβ’ Deep Linking Guide](https://support.appsflyer.com/hc/en-us/articles/208874366-OneLink-Deep-Linking-Guide#Intro). | ||
@@ -110,2 +111,41 @@ | ||
### <a id="Unified-deep-linking"> 3. Unified deep linking | ||
In order to use the unified deep link you need to send the `onDeepLinkListener: true` flag inside the object that sent to the sdk.<br> | ||
**NOTE:** when sending this flag, the sdk will ignore `onAppOpenAttribution`!<br> | ||
For more information about this api, please check [OneLink Guide Here](https://dev.appsflyer.com/docs/android-unified-deep-linking) | ||
```javascript | ||
var onDeepLinkCanceller = appsFlyer.onDeepLink(res => { | ||
console.log('onDeepLinking: ' + JSON.stringify(res)); | ||
console.log('status: '+ res.status); | ||
console.log('type: '+ res.type); | ||
}) | ||
appsFlyer.initSdk( | ||
{ | ||
devKey: 'K2***********99', | ||
isDebug: false, | ||
appId: '41*****44', | ||
onInstallConversionDataListener: true, | ||
onDeepLinkListener: true | ||
}, | ||
(result) => { | ||
console.log(result); | ||
}, | ||
(error) => { | ||
console.error(error); | ||
} | ||
); | ||
``` | ||
**Note:** The code implementation for `onDeepLink` must be made **prior to the initialization** code of the SDK. | ||
**Important** | ||
The `appsFlyer.onDeepLink` returns function to unregister this event listener. If you want to remove the listener for any reason, you can simply call `onDeepLinkCanceller()`. This function will call `NativeAppEventEmitter.remove()`. | ||
<hr/> | ||
### *Example:* | ||
@@ -120,2 +160,6 @@ | ||
var onDeepLinkCanceller = appsFlyer.onDeepLink(res => { | ||
console.log('onDeepLinking: ' + JSON.stringify(res)); | ||
}) | ||
var onInstallConversionDataCanceller = appsFlyer.onInstallConversionData( | ||
@@ -165,2 +209,7 @@ (res) => { | ||
} | ||
if (onDeepLinkCanceller) { | ||
onDeepLinkCanceller(); | ||
console.log('unregister onDeepLinkCanceller'); | ||
onDeepLinkCanceller = null; | ||
} | ||
} | ||
@@ -167,0 +216,0 @@ } |
@@ -13,3 +13,3 @@ /** | ||
| "onAttributionFailure" | ||
| "onInstallConversionFailure", | ||
| "onInstallConversionFailure" | ||
data: { | ||
@@ -34,2 +34,3 @@ is_first_launch: "true" | "false"; | ||
onInstallConversionDataListener?: boolean; | ||
onDeepLinkListener?: boolean; | ||
timeToWaitForATTUserAuthorization?: number; // iOS only | ||
@@ -67,2 +68,3 @@ } | ||
onAppOpenAttribution(callback: (data: any) => any): () => void; | ||
onDeepLink(callback: (data: any) => any): () => void; | ||
initSdk(options: InitSDKOptions): Promise<string>; | ||
@@ -69,0 +71,0 @@ initSdk(options: InitSDKOptions, successC: SuccessCB, errorC: ErrorCB): void; |
25
index.js
@@ -384,2 +384,27 @@ import {NativeEventEmitter, NativeModules} from "react-native"; | ||
appsFlyer.onDeepLink = callback => { | ||
const listener = appsFlyerEventEmitter.addListener( | ||
"onDeepLinking", | ||
_data => { | ||
if (callback && typeof callback === typeof Function) { | ||
try { | ||
let data = JSON.parse(_data); | ||
callback(data); | ||
} catch (_error) { | ||
callback(new AFParseJSONException("Invalid data structure", _data)); | ||
} | ||
} | ||
} | ||
); | ||
eventsMap["onDeepLinking"] = listener; | ||
// unregister listener (suppose should be called from componentWillUnmount() ) | ||
return function remove() { | ||
listener.remove(); | ||
}; | ||
}; | ||
/** | ||
@@ -386,0 +411,0 @@ * Anonymize user Data. |
{ | ||
"name": "react-native-appsflyer", | ||
"version": "6.1.10", | ||
"version": "6.1.20", | ||
"description": "React Native Appsflyer plugin", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -120,3 +120,4 @@ | ||
appId: '41*****44', | ||
onInstallConversionDataListener: true, | ||
onInstallConversionDataListener: true, //Optional | ||
onDeepLinkListener: true, //Optional | ||
}, | ||
@@ -138,2 +139,3 @@ (result) => { | ||
|onInstallConversionDataListener| Set listener for SDK init response (Optional. default=true) | | ||
|onDeepLinkListener| Set listener for DDL response (Optional. default=false) | | ||
@@ -140,0 +142,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
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 3 instances 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
1540470
135
586
154
18