Skip to content

Commit

Permalink
Merge pull request #177 from AppsFlyerSDK/releases/5.4.40
Browse files Browse the repository at this point in the history
Releases/5.4.40
  • Loading branch information
sokoloff06 authored Sep 2, 2020
2 parents c5a5e75 + e575fc8 commit 1714227
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 7 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
52 changes: 51 additions & 1 deletion Docs/API.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# API


- [initSdk](#initSdk)
- [appId](#appId)
- [onInstallConversionData](#onInstallConversionData)
- [onAppOpenAttribution](#onAppOpenAttribution)
- [trackEvent](#trackEvent)
Expand All @@ -26,6 +26,8 @@
- [performOnAppAttribution](#performOnAppAttribution)
- [setSharingFilterForAllPartners](#setSharingFilterForAllPartners)
- [setSharingFilter](#setSharingFilter)
- [disableCollectASA](#disableCollectASA)
- [disableAdvertiserIdentifier](#disableAdvertiserIdentifier)

---

Expand Down Expand Up @@ -76,6 +78,17 @@ try {
var res = await appsFlyer.initSdk(options);
} catch (err) {}
```
---

##### <a id="appId"> **`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;
```

---
##### <a id="onInstallConversionData"> **`onInstallConversionData(callback) : function:unregister`**
Expand Down Expand Up @@ -720,3 +733,40 @@ Used by advertisers to exclude **specified** networks/integrated partners from g
})
```
---
##### <a id="disableCollectASA"> **`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);
```
---
##### <a id="disableAdvertiserIdentifier"> **`disableAdvertiserIdentifier(shouldDisable)`**
(iOS only)
Disables IDFA collecting
| parameter | type | description |
| ---------- |----------|------------------ |
| shouldDisable | boolean | Flag to disable/enable IDFA collection |
*Example:*
```javascript
appsFlyer.disableAdvertiserIdentifier(true);
```
---
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

### <a id="plugin-build-for"> 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**


## <a id="installation"> 📲 Adding the SDK to your project
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')}"
}
2 changes: 2 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
41 changes: 41 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function initSdkPromise(options): Promise<string> {
}

function initSdk(options, success, error): Promise<string> {
appsFlyer.appId = options.appId;
options.onInstallConversionDataListener = eventsMap["onInstallConversionData"]
? true
: false;
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 8 additions & 0 deletions ios/RNAppsFlyer.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion react-native-appsflyer.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1714227

Please sign in to comment.