Skip to content

Commit 08908b7

Browse files
releases/6.x.x/6.6.x/6.6.1-rc1
Releases/6.x.x/6.6.x/6.6.1 rc1
2 parents dfcfee6 + bc2db23 commit 08908b7

File tree

9 files changed

+51
-3
lines changed

9 files changed

+51
-3
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Tests
22

3-
on: [pull_request]
3+
on: [pull_request, push]
44

55
jobs:
66
build:

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 6.6.1
2+
Release date: *2022-June-21*
3+
4+
- React Native > add support for the appendParametersToDeepLinkingURL API
5+
16
## 6.6.0
27
Release date: *2022-May-18*
38

Docs/API.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ The list of available methods for this plugin is described below.
2525
- [updateServerUninstallToken](#updateServerUninstallToken)
2626
- [sendPushNotificationData](#sendPushNotificationData)
2727
- [addPushNotificationDeepLinkPath](#addPushNotificationDeepLinkPath)
28+
- [appendParametersToDeepLinkingURL](#appendParametersToDeepLinkingURL)
2829
- [Android Only APIs](#androidOnly)
2930
- [setCollectAndroidID](#setCollectAndroidID)
3031
- [setCollectIMEI](#setCollectIMEI)
@@ -632,6 +633,26 @@ This call matches the following payload structure:
632633
}
633634
```
634635

636+
---
637+
##### <a id="appendParametersToDeepLinkingURL"> **`appendParametersToDeepLinkingURL(contains, parameters): void`**
638+
639+
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>
640+
Note:<br>
641+
1. The `parameters` object must be consisted of `string` key and `string` value
642+
2. Call this api *before* calling `appsFlyer.initSDK()`
643+
3. You must provide the following parameters:
644+
`pid`, `is_retargeting` most be set to `'true'`
645+
646+
| parameter | type | description |
647+
| ---------- |----------|------------------ |
648+
| contains | string | The string to check in URL |
649+
| parameters | object | Parameters to append to the deeplink url after it passed validation |
650+
651+
*Example:*
652+
653+
```javascript
654+
appsFlyer.appendParametersToDeepLinkingURL('substring-of-url', {param1: 'value', pid: 'value2', is_retargeting: 'true'});
655+
```
635656

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

Docs/Expo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# 🚀 Integrate AppsFlyer into an Expo managed project
22
1. Install `expo-dev-client`:
33
```
4-
expo install expo-dev-clients
4+
expo install expo-dev-client
55
```
66
2. Install react-native-appsflyer:
77
```

android/src/main/java/com/appsflyer/reactnative/RNAppsFlyerModule.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,12 @@ public void setPartnerData(String partnerId, ReadableMap partnerData) {
756756
AppsFlyerLib.getInstance().setPartnerData(partnerId, partnerDataAsMap);
757757
}
758758

759+
@ReactMethod
760+
public void appendParametersToDeepLinkingURL(String contains, ReadableMap parameters) {
761+
Map parametersAsMap = RNUtil.toMap(parameters);
762+
AppsFlyerLib.getInstance().appendParametersToDeepLinkingURL(contains, parametersAsMap);
763+
}
764+
759765
@ReactMethod
760766
public void addListener(String eventName) {
761767
// Keep: Required for RN built in Event Emitter Calls.

index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ declare module "react-native-appsflyer" {
141141
disableAdvertisingIdentifier(isDisable: boolean): void
142142
setSharingFilterForPartners(partners: string[]): void
143143
setPartnerData(partnerId: string, partnerData: object): void
144+
appendParametersToDeepLinkingURL(contains: string, parameters: object): void
144145

145146
/**
146147
* For iOS Only

index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,17 @@ appsFlyer.setPartnerData = (partnerId, partnerData) => {
593593
}
594594
};
595595

596+
/**
597+
* 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.
598+
* @param contains: The string to check in URL.
599+
* @param parameters: Parameters to append to the deeplink url after it passed validation.
600+
*/
601+
appsFlyer.appendParametersToDeepLinkingURL = (contains, parameters) => {
602+
if (typeof contains === 'string' && typeof parameters === 'object') {
603+
return RNAppsFlyer.appendParametersToDeepLinkingURL(contains, parameters);
604+
}
605+
};
606+
596607
function AFParseJSONException(_message, _data) {
597608
this.message = _message;
598609
this.data = _data;

ios/RNAppsFlyer.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,4 +539,8 @@ -(void) reportOnSuccess:(NSString *)data type:(NSString*) type {
539539
RCT_EXPORT_METHOD(setPartnerData:(NSString *)partnerId partnerData:(NSDictionary *)partnerData) {
540540
[[AppsFlyerLib shared] setPartnerDataWithPartnerId:partnerId partnerInfo:partnerData];
541541
}
542+
543+
RCT_EXPORT_METHOD(appendParametersToDeepLinkingURL:(NSString *)contains partnerData:(NSDictionary *)parameters) {
544+
[[AppsFlyerLib shared] appendParametersToDeepLinkingURLWithString:contains parameters:parameters];
545+
}
542546
@end

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-appsflyer",
3-
"version": "6.6.0",
3+
"version": "6.6.1",
44
"description": "React Native Appsflyer plugin",
55
"main": "index.js",
66
"types": "index.d.ts",

0 commit comments

Comments
 (0)