diff --git a/CHANGELOG.md b/CHANGELOG.md
index 16eb4cb8..44fea514 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,15 @@
# Versions
+## 5.4.40
+- Android SDK v5.4.3
+- iOS SDK v5.4.4
+- Install Referrer v1.1.2
+
+_New APIs:_
+
+- disableAdvertiserIdentifier
+- disableCollectASA
+
## 5.4.1
- Android and iOS SDK 5.4.1
- iOS lifecycle now handled natively and not from _handleAppStateChange
diff --git a/Docs/API.md b/Docs/API.md
index 5500ef5f..354a1417 100755
--- a/Docs/API.md
+++ b/Docs/API.md
@@ -1,7 +1,7 @@
# API
-
- [initSdk](#initSdk)
+- [appId](#appId)
- [onInstallConversionData](#onInstallConversionData)
- [onAppOpenAttribution](#onAppOpenAttribution)
- [trackEvent](#trackEvent)
@@ -26,6 +26,8 @@
- [performOnAppAttribution](#performOnAppAttribution)
- [setSharingFilterForAllPartners](#setSharingFilterForAllPartners)
- [setSharingFilter](#setSharingFilter)
+- [disableCollectASA](#disableCollectASA)
+- [disableAdvertiserIdentifier](#disableAdvertiserIdentifier)
---
@@ -76,6 +78,17 @@ try {
var res = await appsFlyer.initSdk(options);
} catch (err) {}
```
+---
+
+##### **`appId`**
+
+AppsFlyer app ID property populated from `options` passed in the `initSdk` function. Can be used to read appId back later in the app
+
+*Example:*
+
+```javascript
+var appId = appsFlyer.appId;
+```
---
##### **`onInstallConversionData(callback) : function:unregister`**
@@ -720,3 +733,40 @@ Used by advertisers to exclude **specified** networks/integrated partners from g
})
```
---
+
+##### **`disableCollectASA(shouldDisable)`**
+
+(iOS only)
+
+Disables Apple Search Ads collecting
+
+| parameter | type | description |
+| ---------- |----------|------------------ |
+| shouldDisable | boolean | Flag to disable/enable Apple Search Ads data collection |
+
+*Example:*
+
+```javascript
+
+appsFlyer.disableCollectASA(true);
+```
+
+---
+
+##### **`disableAdvertiserIdentifier(shouldDisable)`**
+
+(iOS only)
+
+Disables IDFA collecting
+
+| parameter | type | description |
+| ---------- |----------|------------------ |
+| shouldDisable | boolean | Flag to disable/enable IDFA collection |
+
+*Example:*
+
+```javascript
+appsFlyer.disableAdvertiserIdentifier(true);
+```
+
+---
\ No newline at end of file
diff --git a/README.md b/README.md
index 5d45199d..4e50e275 100755
--- a/README.md
+++ b/README.md
@@ -19,8 +19,8 @@
### This plugin is built for
-- iOS AppsFlyerSDK **v5.4.1**
-- Android AppsFlyerSDK **v5.4.1**
+- iOS AppsFlyerSDK **v5.4.4**
+- Android AppsFlyerSDK **v5.4.3**
## 📲 Adding the SDK to your project
diff --git a/android/build.gradle b/android/build.gradle
index 68e4856a..fc75b40d 100755
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -29,6 +29,6 @@ repositories {
dependencies {
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
- implementation "com.android.installreferrer:installreferrer:${safeExtGet('installReferrerVersion', '1.0')}"
- implementation "com.appsflyer:af-android-sdk:${safeExtGet('appsflyerVersion', '5.4.1')}"
+ implementation "com.android.installreferrer:installreferrer:${safeExtGet('installReferrerVersion', '2.1')}"
+ implementation "com.appsflyer:af-android-sdk:${safeExtGet('appsflyerVersion', '5.4.3')}"
}
diff --git a/index.d.ts b/index.d.ts
index d04b009e..de71a37e 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -75,6 +75,8 @@ declare module "react-native-appsflyer" {
* */
trackAppLaunch(): void
trackLocation(longitude: number, latitude: number, callback: SuccessCB): void
+ disableAdvertiserIdentifier(shouldDisable: boolean):void
+ disableCollectASA(shouldDisable: boolean):void
/**
* For Android Only
diff --git a/index.js b/index.js
index c8f8cab3..a64b3e3e 100755
--- a/index.js
+++ b/index.js
@@ -15,6 +15,7 @@ function initSdkPromise(options): Promise {
}
function initSdk(options, success, error): Promise {
+ appsFlyer.appId = options.appId;
options.onInstallConversionDataListener = eventsMap["onInstallConversionData"]
? true
: false;
@@ -362,18 +363,58 @@ appsFlyer.setResolveDeepLinkURLs = (urls, successC, errorC) => {
return RNAppsFlyer.setResolveDeepLinkURLs(urls, successC, errorC);
};
+/**
+ * This function allows developers to manually re-trigger onAppOpenAttribution with a specific link (URI or URL),
+ * without recording a new re-engagement.
+ * This method may be required if the app needs to redirect users based on the given link,
+ * or resolve the AppsFlyer short URL while staying in the foreground/opened. This might be needed because
+ * regular onAppOpenAttribution callback is only called if the app was opened with the deep link.
+ * @param urlString String representing the URL that needs to be resolved/returned in the onAppOpenAttribution callback
+ * @param callback Result callback
+ */
appsFlyer.performOnAppAttribution = (urlString, callback) => {
return RNAppsFlyer.performOnAppAttribution(urlString, callback);
}
+/**
+ * Used by advertisers to exclude **all** networks/integrated partners from getting data.
+ * Learn more - https://support.appsflyer.com/hc/en-us/articles/207032126#additional-apis-exclude-partners-from-getting-data
+ */
+
appsFlyer.setSharingFilterForAllPartners = () => {
return RNAppsFlyer.setSharingFilterForAllPartners();
}
+/**
+ * Used by advertisers to exclude specified networks/integrated partners from getting data.
+ * Learn more - https://support.appsflyer.com/hc/en-us/articles/207032126#additional-apis-exclude-partners-from-getting-data
+ * @param partners Comma separated array of partners that need to be excluded
+ * @param successC Success callback
+ * @param errorC Error callback
+ */
+
appsFlyer.setSharingFilter = (partners, successC, errorC) => {
return RNAppsFlyer.setSharingFilter(partners, successC, errorC);
}
+/**
+ * Disables IDFA collecting
+ * @param shouldDisable Flag to disable/enable IDFA collection
+ * @platform iOS only
+ */
+appsFlyer.disableAdvertiserIdentifier = (shouldDisable) => {
+ return RNAppsFlyer.disableAdvertiserIdentifier(shouldDisable);
+}
+
+/**
+ * Disables Apple Search Ads collecting
+ * @param shouldDisable Flag to disable/enable Apple Search Ads data collection
+ * @platform iOS only
+ */
+appsFlyer.disableCollectASA = (shouldDisable) => {
+ return RNAppsFlyer.disableCollectASA(shouldDisable);
+}
+
function AFParseJSONException(_message, _data) {
this.message = _message;
this.data = _data;
diff --git a/ios/RNAppsFlyer.m b/ios/RNAppsFlyer.m
index 72736bd0..186b6785 100755
--- a/ios/RNAppsFlyer.m
+++ b/ios/RNAppsFlyer.m
@@ -447,4 +447,12 @@ -(void) reportOnSuccess:(NSString *)data type:(NSString*) type {
successCallback(@[SUCCESS]);
}
+RCT_EXPORT_METHOD(disableAdvertiserIdentifier:(BOOL)shouldDisable) {
+ [AppsFlyerTracker sharedTracker].disableAppleAdSupportTracking = shouldDisable;
+}
+
+RCT_EXPORT_METHOD(disableCollectASA: (BOOL)shouldDisable) {
+ [AppsFlyerTracker sharedTracker].disableIAdTracking = shouldDisable;
+}
+
@end
diff --git a/package.json b/package.json
index 914024b3..e160aca4 100755
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "react-native-appsflyer",
- "version": "5.4.1",
+ "version": "5.4.40",
"description": "React Native Appsflyer plugin",
"main": "index.js",
"scripts": {
diff --git a/react-native-appsflyer.podspec b/react-native-appsflyer.podspec
index e45b3de2..0bd865a6 100644
--- a/react-native-appsflyer.podspec
+++ b/react-native-appsflyer.podspec
@@ -13,6 +13,6 @@ Pod::Spec.new do |s|
s.source_files = 'ios/**/*.{h,m}'
s.platform = :ios, "8.0"
s.static_framework = true
- s.dependency 'AppsFlyerFramework', '~> 5.4.1'
+ s.dependency 'AppsFlyerFramework', '~> 5.4.4'
s.dependency 'React'
end