Skip to content

Commit

Permalink
Merge pull request #436 from AppsFlyerSDK/releases/6.x.x/6.9.x/6.9.2-rc1
Browse files Browse the repository at this point in the history
Releases/6.x.x/6.9.x/6.9.2 rc1
  • Loading branch information
amit-kremer93 authored Oct 20, 2022
2 parents 15e2a9e + b0284e7 commit d8157d7
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 6.9.2
Release date: *2022-10-20*

- React Native Plugin - add support for the disableIDFVCollection API

## 6.9.1
Release date: *2022-09-22*

Expand Down
20 changes: 20 additions & 0 deletions Docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ The list of available methods for this plugin is described below.
- [setUseReceiptValidationSandbox](#setUseReceiptValidationSandbox)
- [disableSKAD](#disableSKAD)
- [setCurrentDeviceLanguage](#setCurrentDeviceLanguage)
- [disableIDFVCollection](#disableIDFVCollection)
- [AppsFlyerConversionData](#AppsFlyerConversionData)
- [onInstallConversionData](#onInstallConversionData)
- [onInstallConversionFailure](#onInstallConversionFailure)
Expand Down Expand Up @@ -826,6 +827,25 @@ appsFlyer.disableCollectASA(true);

---

##### <a id="disableIDFVCollection"> **`disableIDFVCollection(shouldDisable)`**

Disables app vendor identifier (IDFV) collection in iOS.<br>
Default is false (the SDK will collect IDFV).

| parameter | type | description |
| ---------- |----------|------------------ |
| shouldDisable | boolean | Flag to disable/enable IDFV collection |

*Example:*

```javascript
if (Platform.OS == 'ios') {
appsFlyer.disableIDFVCollection(true);
}
```

---

##### <a id="setUseReceiptValidationSandbox"> **`void setUseReceiptValidationSandbox(bool useReceiptValidationSandbox)`**


Expand Down
5 changes: 5 additions & 0 deletions __tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@ describe("Test appsFlyer API's", () => {
appsFlyer.performOnDeepLinking();
expect(RNAppsFlyer.performOnDeepLinking).toHaveBeenCalledTimes(1);
});

test('it calls appsFlyer.disableIDFVCollection()', () => {
appsFlyer.disableIDFVCollection(true);
expect(RNAppsFlyer.disableIDFVCollection).toHaveBeenCalledTimes(1);
});
});

describe('Test native event emitter', () => {
Expand Down
1 change: 1 addition & 0 deletions __tests__/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jest.mock('../node_modules/react-native/Libraries/BatchedBridge/NativeModules',
setDisableNetworkData: jest.fn(),
performOnDeepLinking: jest.fn(),
startSdk: jest.fn(),
disableIDFVCollection: jest.fn(),
},
};
});
Expand Down
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ declare module "react-native-appsflyer" {
setUseReceiptValidationSandbox(isSandbox: boolean): void
disableSKAD(disableSkad: boolean): void
setCurrentDeviceLanguage(language: string): void
disableIDFVCollection(shouldDisable: boolean): void

/**
* For Android Only
Expand Down
9 changes: 9 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,15 @@ appsFlyer.disableAdvertisingIdentifier = (isDisable) => {
return RNAppsFlyer.disableAdvertisingIdentifier(isDisable);
};

/**
* Disables app vendor identifier (IDFV) collection in iOS
* @param shouldDisable Flag to disable/enable IDFA collection
* @platform iOS only
*/
appsFlyer.disableIDFVCollection = (shouldDisable) => {
return RNAppsFlyer.disableIDFVCollection(shouldDisable);
};

/**
* Disables Apple Search Ads collecting
* @param shouldDisable Flag to disable/enable Apple Search Ads data collection
Expand Down
5 changes: 5 additions & 0 deletions ios/RNAppsFlyer.m
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,15 @@ -(void) reportOnSuccess:(NSString *)data type:(NSString*) type {
[AppsFlyerLib shared].disableAdvertisingIdentifier = shouldDisable;
}
#endif

RCT_EXPORT_METHOD(disableCollectASA: (BOOL)shouldDisable) {
[AppsFlyerLib shared].disableCollectASA = shouldDisable;
}

RCT_EXPORT_METHOD(disableIDFVCollection: (BOOL)shouldDisable) {
[[AppsFlyerLib shared] setDisableIDFVCollection:shouldDisable];
}

RCT_EXPORT_METHOD(setUseReceiptValidationSandbox: (BOOL)isSandbox) {
[AppsFlyerLib shared].useReceiptValidationSandbox = isSandbox;
}
Expand Down
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": "6.9.1",
"version": "6.9.2",
"description": "React Native Appsflyer plugin",
"main": "index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit d8157d7

Please sign in to comment.