Skip to content

Commit

Permalink
6.1.30
Browse files Browse the repository at this point in the history
6.1.30
  • Loading branch information
amit-kremer93 authored Dec 30, 2020
2 parents 0768595 + 87da1ee commit 77106dd
Show file tree
Hide file tree
Showing 15 changed files with 152 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Versions
## 6.1.30
- Android SDK 6.1.3
- iOS SDK 6.1.3
- setHost API
- addPushNotificationDeepLinkPath API

## 6.1.20
- Unified deep linking

Expand Down
39 changes: 39 additions & 0 deletions Docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
- [disableAdvertisingIdentifier](#disableAdvertisingIdentifier)
- [validateAndLogInAppPurchase](#validateAndLogInAppPurchase)
- [sendPushNotificationData](#sendPushNotificationData)
- [setHost](#setHost)
- [addPushNotificationDeepLinkPath](#addPushNotificationDeepLinkPath)

---

Expand Down Expand Up @@ -817,3 +819,40 @@ const pushPayload = {
};
appsFlyer.sendPushNotificationData(pushPayload);
```
---
##### <a id="setHost"> **`setHost(hostPrefix, hostName, successC)`**
Set a custom host
| parameter | type | description |
| ----------|----------|------------------|
| hostPrefix | string | the host prefix |
| hostName | string | the host name |
| successC | function | success callback |
*Example:*
```javascript
appsFlyer.setHost('foo', 'bar.appsflyer.com', res => console.log(res));
```
---
##### <a id="addPushNotificationDeepLinkPath"> **`addPushNotificationDeepLinkPath(path, successC, errorC)`**
The addPushNotificationDeepLinkPath method provides app owners with a flexible interface for configuring how deep links are extracted from push notification payloads.
for more information: https://support.appsflyer.com/hc/en-us/articles/207032126-Android-SDK-integration-for-developers#core-apis-65-configure-push-notification-deep-link-resolution <br>
❗Important❗ `addPushNotificationDeepLinkPath` must be called before calling `initSDK`
| parameter | type | description |
| ----------|----------|------------------|
| path | strings array | the desired path separated into an array |
| successC | function | success callback |
| errorC | function | error callback |
*Example:*
```javascript
appsFlyer.addPushNotificationDeepLinkPath(["deeply", "nested", "deep_link"], res => console.log(res), error => console.log(error));
```
6 changes: 3 additions & 3 deletions Docs/Guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ Since users may or may not have the mobile app installed, there are 3 types of d
1. Deferred Deep Linking - Serving personalized content to new or former users, directly after the installation.
2. Direct Deep Linking - Directly serving personalized content to existing users, which already have the mobile app installed.
3. Unified deep linking - Unified deep linking sends new and existing users to a specific in-app activity as soon as the app is opened.<br>
For more info please check out the [OneLink™ Deep Linking Guide](https://support.appsflyer.com/hc/en-us/articles/208874366-OneLink-Deep-Linking-Guide#Intro).
For more info please check out the [OneLink™ Deep Linking Guide](https://dev.appsflyer.com/docs/initial-setup-for-deep-linking-and-deferred-deep-linking).

### <a id="deferred-deep-linking"> 1. Deferred Deep Linking (Get Conversion Data)

Check out the deferred deep linking guide from the AppFlyer knowledge base [here](https://support.appsflyer.com/hc/en-us/articles/207032096-Accessing-AppsFlyer-Attribution-Conversion-Data-from-the-SDK-Deferred-Deeplinking-#Introduction).
Check out the deferred deep linking guide from the AppFlyer knowledge base [here](https://dev.appsflyer.com/docs/deferred-deep-linking-new-users-to-specific-content-inside-your-app).

Code Sample to handle the conversion data:

Expand Down Expand Up @@ -88,7 +88,7 @@ The `appsFlyer.onInstallConversionData` returns function to unregister this eve

### <a id="direct-deep-linking"> 2. Direct Deep Linking

When a deep link is clicked on the device the AppsFlyer SDK will return the link in the [onAppOpenAttribution](https://support.appsflyer.com/hc/en-us/articles/208874366-OneLink-Deep-Linking-Guide#deep-linking-data-the-onappopenattribution-method-) method.
When a deep link is clicked on the device the AppsFlyer SDK will return the link in the [onAppOpenAttribution](https://dev.appsflyer.com/docs/deep-linking-existing-app-users-to-specific-content) method.

```javascript
var onAppOpenAttributionCanceller = appsFlyer.onAppOpenAttribution((res) => {
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

### <a id="plugin-build-for"> This plugin is built for

- iOS AppsFlyerSDK **v6.1.1**
- Android AppsFlyerSDK **v6.1.0**
- iOS AppsFlyerSDK **v6.1.3**
- Android AppsFlyerSDK **v6.1.3**

## <a id="v6-breaking-changes"> ❗ v6 Breaking Changes

Expand All @@ -37,6 +37,7 @@ We have renamed the following APIs:
| trackCrossPromotionImpression | logCrossPromotionImpression |
| trackAndOpenStore | logCrossPromotionAndOpenStore |
| setDeviceTrackingDisabled | anonymizeUser |
| AppsFlyerTracker | AppsFlyerLib |

And removed the following ones:

Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ repositories {
dependencies {
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
implementation "com.android.installreferrer:installreferrer:${safeExtGet('installReferrerVersion', '2.1')}"
implementation "com.appsflyer:af-android-sdk:${safeExtGet('appsflyerVersion', '6.1.0')}"
implementation "com.appsflyer:af-android-sdk:${safeExtGet('appsflyerVersion', '6.1.3')}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -677,4 +677,27 @@ public void onValidateInAppFailure(String error) {
public void sendPushNotificationData(ReadableMap pushPayload) {
AppsFlyerLib.getInstance().sendPushNotificationData(getCurrentActivity());
}

@ReactMethod
public void setHost(String hostPrefix, String hostName, Callback successCallback) {
AppsFlyerLib.getInstance().setHost(hostPrefix, hostName);
successCallback.invoke(SUCCESS);
}

@ReactMethod
public void addPushNotificationDeepLinkPath(ReadableArray path, Callback successCallback, Callback errorCallback) {
if (path.size() <= 0) {
errorCallback.invoke(EMPTY_OR_CORRUPTED_LIST);
return;
}
ArrayList<Object> pathList = path.toArrayList();
try {
String[] params = pathList.toArray(new String[pathList.size()]);
AppsFlyerLib.getInstance().addPushNotificationDeepLinkPath(params);
successCallback.invoke(SUCCESS);
} catch (Exception e) {
e.printStackTrace();
errorCallback.invoke(e);
}
}
}
2 changes: 2 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ declare module "react-native-appsflyer" {
validateAndLogInAppPurchase(purchaseInfo: InAppPurchase, successC, errorC): Response<string>
updateServerUninstallToken(token: string, successC?: SuccessCB): void
sendPushNotificationData(pushPayload: object): void
setHost(hostPrefix: string, hostName: string, success: SuccessCB): void
addPushNotificationDeepLinkPath(path: string[], successC: SuccessCB, errorC: ErrorCB): void

/**
* For iOS Only
Expand Down
20 changes: 20 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,26 @@ appsFlyer.sendPushNotificationData = (pushPayload) => {
RNAppsFlyer.sendPushNotificationData(pushPayload);
}

/**
* Set a custom host
* @param hostPrefix
* @param hostName
* @param successC: success callback
*/
appsFlyer.setHost = (hostPrefix, hostName, successC) => {
RNAppsFlyer.setHost(hostPrefix, hostName, successC);
}

/**
* The addPushNotificationDeepLinkPath method provides app owners with a flexible interface for configuring how deep links are extracted from push notification payloads.
* for more information: https://support.appsflyer.com/hc/en-us/articles/207032126-Android-SDK-integration-for-developers#core-apis-65-configure-push-notification-deep-link-resolution
* @param path: an array of string that represents the path
* @param successC: success callback
* @param errorC: error callback
*/
appsFlyer.addPushNotificationDeepLinkPath = (path, successC, errorC) => {
RNAppsFlyer.addPushNotificationDeepLinkPath(path, successC, errorC);
}

function AFParseJSONException(_message, _data) {
this.message = _message;
Expand Down
29 changes: 29 additions & 0 deletions ios/AppsFlyerDeepLinkObserver.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// AFSDKDeepLinkObserver.h
// AppsFlyerLib
//
// Created by Andrii Hahan on 09.09.2020.
//

#import <Foundation/Foundation.h>

@class AppsFlyerDeepLinkResult;

NS_SWIFT_NAME(DeepLinkObserverDelegate)
@protocol AppsFlyerDeepLinkObserverDelegate <NSObject>

@optional
- (void)didResolveDeepLink:(AppsFlyerDeepLinkResult *_Nonnull)result;

@end

NS_ASSUME_NONNULL_BEGIN
NS_SWIFT_NAME(DeepLinkObserver)
@interface AppsFlyerDeepLinkObserver : NSObject

@property(weak, nonatomic) id<AppsFlyerDeepLinkObserverDelegate> delegate;
@property NSTimeInterval timeoutInterval;

@end

NS_ASSUME_NONNULL_END
12 changes: 11 additions & 1 deletion ios/AppsFlyerLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// AppsFlyerLib.h
// AppsFlyerLib
//
// AppsFlyer iOS SDK 6.1.1 (33)
// AppsFlyer iOS SDK 6.1.3 (43)
// Copyright (c) 2012-2020 AppsFlyer Ltd. All rights reserved.
//

Expand Down Expand Up @@ -298,6 +298,8 @@ NS_SWIFT_NAME(waitForATTUserAuthorization(timeoutInterval:));
*/
@property(atomic) BOOL disableCollectASA;

@property(nonatomic) BOOL disableAppleAdsAttribution;

/**
AppsFlyer delegate. See `AppsFlyerLibDelegate`
*/
Expand Down Expand Up @@ -615,6 +617,14 @@ NS_SWIFT_NAME(logEvent(name:values:completionHandler:));
parameters:(NSDictionary<NSString *, NSString*> *)parameters
NS_SWIFT_NAME(appendParametersToDeeplinkURL(contains:parameters:));

/**
Adds array of keys, which are used to compose key path
to resolve deeplink from push notification payload `userInfo`.
@param deepLinkPath an array of strings which contains keys to search for deeplink in payload.
*/
- (void)addPushNotificationDeepLinkPath:(NSArray<NSString *> *)deepLinkPath;

@end

NS_ASSUME_NONNULL_END
11 changes: 11 additions & 0 deletions ios/RNAppsFlyer.m
Original file line number Diff line number Diff line change
Expand Up @@ -526,4 +526,15 @@ -(void) reportOnSuccess:(NSString *)data type:(NSString*) type {
[[AppsFlyerLib shared] handlePushNotification:pushPayload];
}

RCT_EXPORT_METHOD(setHost: (NSString*)hostPrefix hostName: (NSString*)hostName successCallback :(RCTResponseSenderBlock)successCallback) {
[[AppsFlyerLib shared] setHost:hostName withHostPrefix:hostPrefix];
successCallback(@[SUCCESS]);
}

RCT_EXPORT_METHOD(addPushNotificationDeepLinkPath: (NSArray*)path successCallback :(RCTResponseSenderBlock)successCallback
errorCallback:(RCTResponseErrorBlock)errorCallback) {
[[AppsFlyerLib shared] addPushNotificationDeepLinkPath: path];
successCallback(@[SUCCESS]);
}

@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.1.20",
"version": "6.1.30",
"description": "React Native Appsflyer plugin",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion podspec-regular-template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ Pod::Spec.new do |s|
s.platform = :ios, "8.0"
s.static_framework = true
s.dependency 'React'
s.dependency 'AppsFlyerFramework', '6.1.1'
s.dependency 'AppsFlyerFramework', '6.1.3'
end
2 changes: 1 addition & 1 deletion podspec-strict-template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ Pod::Spec.new do |s|
s.platform = :ios, "8.0"
s.static_framework = true
s.dependency 'React'
s.dependency 'AppsFlyerFramework/Strict', '6.1.1'
s.dependency 'AppsFlyerFramework/Strict', '6.1.3'
s.xcconfig = {'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) AFSDK_NO_IDFA=1' }
end
2 changes: 1 addition & 1 deletion react-native-appsflyer.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ Pod::Spec.new do |s|
s.platform = :ios, "8.0"
s.static_framework = true
s.dependency 'React'
s.dependency 'AppsFlyerFramework', ' 6.1.1'
s.dependency 'AppsFlyerFramework', ' 6.1.3'
end

0 comments on commit 77106dd

Please sign in to comment.