Skip to content

Commit

Permalink
releases/6.x.x/6.6.x/6.6.1-rc1
Browse files Browse the repository at this point in the history
Releases/6.x.x/6.6.x/6.6.1 rc1
  • Loading branch information
amit-kremer93 committed Jun 21, 2022
2 parents dfcfee6 + bc2db23 commit 08908b7
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Tests

on: [pull_request]
on: [pull_request, push]

jobs:
build:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 6.6.1
Release date: *2022-June-21*

- React Native > add support for the appendParametersToDeepLinkingURL API

## 6.6.0
Release date: *2022-May-18*

Expand Down
21 changes: 21 additions & 0 deletions Docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The list of available methods for this plugin is described below.
- [updateServerUninstallToken](#updateServerUninstallToken)
- [sendPushNotificationData](#sendPushNotificationData)
- [addPushNotificationDeepLinkPath](#addPushNotificationDeepLinkPath)
- [appendParametersToDeepLinkingURL](#appendParametersToDeepLinkingURL)
- [Android Only APIs](#androidOnly)
- [setCollectAndroidID](#setCollectAndroidID)
- [setCollectIMEI](#setCollectIMEI)
Expand Down Expand Up @@ -632,6 +633,26 @@ This call matches the following payload structure:
}
```

---
##### <a id="appendParametersToDeepLinkingURL"> **`appendParametersToDeepLinkingURL(contains, parameters): void`**

Matches URLs that contain `contains` as a substring and appends query parameters to them. In case the URL does not match, parameters are not appended to it.<br>
Note:<br>
1. The `parameters` object must be consisted of `string` key and `string` value
2. Call this api *before* calling `appsFlyer.initSDK()`
3. You must provide the following parameters:
`pid`, `is_retargeting` most be set to `'true'`

| parameter | type | description |
| ---------- |----------|------------------ |
| contains | string | The string to check in URL |
| parameters | object | Parameters to append to the deeplink url after it passed validation |

*Example:*

```javascript
appsFlyer.appendParametersToDeepLinkingURL('substring-of-url', {param1: 'value', pid: 'value2', is_retargeting: 'true'});
```

## <a id="androidOnly"> Android Only APIs

Expand Down
2 changes: 1 addition & 1 deletion Docs/Expo.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 🚀 Integrate AppsFlyer into an Expo managed project
1. Install `expo-dev-client`:
```
expo install expo-dev-clients
expo install expo-dev-client
```
2. Install react-native-appsflyer:
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,12 @@ public void setPartnerData(String partnerId, ReadableMap partnerData) {
AppsFlyerLib.getInstance().setPartnerData(partnerId, partnerDataAsMap);
}

@ReactMethod
public void appendParametersToDeepLinkingURL(String contains, ReadableMap parameters) {
Map parametersAsMap = RNUtil.toMap(parameters);
AppsFlyerLib.getInstance().appendParametersToDeepLinkingURL(contains, parametersAsMap);
}

@ReactMethod
public void addListener(String eventName) {
// Keep: Required for RN built in Event Emitter Calls.
Expand Down
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ declare module "react-native-appsflyer" {
disableAdvertisingIdentifier(isDisable: boolean): void
setSharingFilterForPartners(partners: string[]): void
setPartnerData(partnerId: string, partnerData: object): void
appendParametersToDeepLinkingURL(contains: string, parameters: object): void

/**
* For iOS Only
Expand Down
11 changes: 11 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,17 @@ appsFlyer.setPartnerData = (partnerId, partnerData) => {
}
};

/**
* Matches URLs that contain contains as a substring and appends query parameters to them. In case the URL does not match, parameters are not appended to it.
* @param contains: The string to check in URL.
* @param parameters: Parameters to append to the deeplink url after it passed validation.
*/
appsFlyer.appendParametersToDeepLinkingURL = (contains, parameters) => {
if (typeof contains === 'string' && typeof parameters === 'object') {
return RNAppsFlyer.appendParametersToDeepLinkingURL(contains, parameters);
}
};

function AFParseJSONException(_message, _data) {
this.message = _message;
this.data = _data;
Expand Down
4 changes: 4 additions & 0 deletions ios/RNAppsFlyer.m
Original file line number Diff line number Diff line change
Expand Up @@ -539,4 +539,8 @@ -(void) reportOnSuccess:(NSString *)data type:(NSString*) type {
RCT_EXPORT_METHOD(setPartnerData:(NSString *)partnerId partnerData:(NSDictionary *)partnerData) {
[[AppsFlyerLib shared] setPartnerDataWithPartnerId:partnerId partnerInfo:partnerData];
}

RCT_EXPORT_METHOD(appendParametersToDeepLinkingURL:(NSString *)contains partnerData:(NSDictionary *)parameters) {
[[AppsFlyerLib shared] appendParametersToDeepLinkingURLWithString:contains parameters:parameters];
}
@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": "6.6.0",
"version": "6.6.1",
"description": "React Native Appsflyer plugin",
"main": "index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit 08908b7

Please sign in to comment.