From ffa99ead81ec6f4ca439908402d5fc0fd9089958 Mon Sep 17 00:00:00 2001 From: Amit Date: Thu, 24 Dec 2020 13:50:46 +0200 Subject: [PATCH 1/6] update iOS sdk 6.1.3 --- package.json | 2 +- plugin.xml | 4 ++-- src/ios/AppsFlyerDeepLinkObserver.h | 29 +++++++++++++++++++++++++++++ src/ios/AppsFlyerLib.h | 12 +++++++++++- 4 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 src/ios/AppsFlyerDeepLinkObserver.h diff --git a/package.json b/package.json index 48e0ddae..7b1dc6cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-appsflyer-sdk", - "version": "6.1.20", + "version": "6.1.30", "description": "Cordova AppsFlyer SDK Plugin", "cordova": { "id": "cordova-plugin-appsflyer-sdk", diff --git a/plugin.xml b/plugin.xml index 27acd9dc..aecf6b0a 100644 --- a/plugin.xml +++ b/plugin.xml @@ -21,7 +21,7 @@ + version="6.1.30"> AppsFlyer Cordova Plugin AppsFlyer Apache 2.0 @@ -89,7 +89,7 @@ - + diff --git a/src/ios/AppsFlyerDeepLinkObserver.h b/src/ios/AppsFlyerDeepLinkObserver.h new file mode 100644 index 00000000..395a6d45 --- /dev/null +++ b/src/ios/AppsFlyerDeepLinkObserver.h @@ -0,0 +1,29 @@ +// +// AFSDKDeepLinkObserver.h +// AppsFlyerLib +// +// Created by Andrii Hahan on 09.09.2020. +// + +#import + +@class AppsFlyerDeepLinkResult; + +NS_SWIFT_NAME(DeepLinkObserverDelegate) +@protocol AppsFlyerDeepLinkObserverDelegate + +@optional +- (void)didResolveDeepLink:(AppsFlyerDeepLinkResult *_Nonnull)result; + +@end + +NS_ASSUME_NONNULL_BEGIN +NS_SWIFT_NAME(DeepLinkObserver) +@interface AppsFlyerDeepLinkObserver : NSObject + +@property(weak, nonatomic) id delegate; +@property NSTimeInterval timeoutInterval; + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/ios/AppsFlyerLib.h b/src/ios/AppsFlyerLib.h index 60572408..8a4c602a 100644 --- a/src/ios/AppsFlyerLib.h +++ b/src/ios/AppsFlyerLib.h @@ -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. // @@ -298,6 +298,8 @@ NS_SWIFT_NAME(waitForATTUserAuthorization(timeoutInterval:)); */ @property(atomic) BOOL disableCollectASA; +@property(nonatomic) BOOL disableAppleAdsAttribution; + /** AppsFlyer delegate. See `AppsFlyerLibDelegate` */ @@ -615,6 +617,14 @@ NS_SWIFT_NAME(logEvent(name:values:completionHandler:)); parameters:(NSDictionary *)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 *)deepLinkPath; + @end NS_ASSUME_NONNULL_END From b7e7f64194ddb8ad2c9958f9d563a17e651adeaa Mon Sep 17 00:00:00 2001 From: Amit Date: Mon, 11 Jan 2021 09:00:04 +0200 Subject: [PATCH 2/6] update Android sdk 6.1.3 --- README.md | 4 ++-- src/android/cordovaAF.gradle | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3c7a7395..adc6e54a 100755 --- a/README.md +++ b/README.md @@ -36,8 +36,8 @@ You can read more [here](https://support.appsflyer.com/hc/en-us/articles/2070320 ### 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** ### ❗v6 Breaking Changes diff --git a/src/android/cordovaAF.gradle b/src/android/cordovaAF.gradle index 3b9d69ab..ade4e06c 100644 --- a/src/android/cordovaAF.gradle +++ b/src/android/cordovaAF.gradle @@ -4,6 +4,6 @@ repositories { dependencies { implementation 'com.android.installreferrer:installreferrer:2.1' - implementation 'com.appsflyer:af-android-sdk:6.1.0@aar' + implementation 'com.appsflyer:af-android-sdk:6.1.3@aar' } From 40c0cae554eb850aaadcbed9c7feac632bbb0f7f Mon Sep 17 00:00:00 2001 From: Amit Date: Mon, 11 Jan 2021 09:51:54 +0200 Subject: [PATCH 3/6] add setHost api --- docs/API.md | 20 ++++++++++++- .../cordova/plugin/AppsFlyerPlugin.java | 28 +++++++++++++++++-- src/ios/AppsFlyerPlugin.m | 8 ++++++ www/appsflyer.js | 9 ++++++ 4 files changed, 62 insertions(+), 3 deletions(-) diff --git a/docs/API.md b/docs/API.md index 683a0cb8..0aa32b25 100755 --- a/docs/API.md +++ b/docs/API.md @@ -38,7 +38,8 @@ The list of available methods for this plugin is described below. | [`setOneLinkCustomDomains`](#setOneLinkCustomDomains) | `(domains, function success, function error)` | Set Onelink custom/branded domains | | [`enableFacebookDeferredApplinks`](#enableFacebookDeferredApplinks) | `(boolean isEnabled)` | support deferred deep linking from Facebook Ads | | [`setUserEmails`](#setUserEmails) | `(emails, function success)` | Set user emails for FB Advanced Matching | -| [`setPhoneNumber`](#setPhoneNumber) | `(String phoneNumber, function successr)` | Set phone number for FB Advanced Matching | +| [`setPhoneNumber`](#setPhoneNumber) | `(String phoneNumber, function success)` | Set phone number for FB Advanced Matching | +| [`setHost`](#setHost) | `(String hostPrefix, String hostName)` | Set custom host prefix and host name | --- @@ -569,6 +570,23 @@ window.plugins.appsFlyer.setPhoneNumber(phoneNumber, successC); | `phoneNumber` | `String` | String phone number | | `successC` | `function` | will trigger if the number was sent successfully | +--- +##### **`setHost(String hostPrefix, String hostName): void`** +Set custom host prefix and host name
+ +*Example:* + +```javascript +let prefix = "another" +let name = "host" +window.plugins.appsFlyer.setHost(prefix, name); +``` + +| parameter | type | description | +| ----------- |-----------------------------|--------------| +| `hostPrefix` | `String` | host prefix | +| `hostName` | `String` | host name | + --- ###
Deep linking Tracking diff --git a/src/android/com/appsflyer/cordova/plugin/AppsFlyerPlugin.java b/src/android/com/appsflyer/cordova/plugin/AppsFlyerPlugin.java index 9e07fbce..a2e81ec2 100644 --- a/src/android/com/appsflyer/cordova/plugin/AppsFlyerPlugin.java +++ b/src/android/com/appsflyer/cordova/plugin/AppsFlyerPlugin.java @@ -3,6 +3,7 @@ import android.net.Uri; import java.util.ArrayList; +import java.util.EmptyStackException; import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -112,6 +113,8 @@ public boolean execute(final String action, JSONArray args, CallbackContext call return setPhoneNumber(args, callbackContext); } else if ("setUserEmails".equals(action)) { return setUserEmails(args, callbackContext); + } else if ("setHost".equals(action)) { + return setHost(args); } return false; @@ -890,6 +893,7 @@ private boolean setOneLinkCustomDomains(JSONArray parameters, CallbackContext ca * use this api If you need deep linking data from Facebook, deferred deep linking, Dynamic Product Ads, or reasons that * unrelated to attribution such as authentication, ad monetization, social sharing, user invites, etc. * More information here: https://support.appsflyer.com/hc/en-us/articles/207033826-Facebook-Ads-setup-guide#integration + * * @param args: boolean value * @return */ @@ -907,7 +911,8 @@ private boolean enableFacebookDeferredApplinks(JSONArray args) { /** * Facebook Advanced Matching - * @param args: Strings array of emails + * + * @param args: Strings array of emails * @param callbackContext: success functions * @return */ @@ -926,7 +931,8 @@ private boolean setUserEmails(JSONArray args, CallbackContext callbackContext) { /** * Facebook Advanced Matching - * @param args: phone number + * + * @param args: phone number * @param callbackContext * @return */ @@ -942,6 +948,24 @@ private boolean setPhoneNumber(JSONArray args, CallbackContext callbackContext) return true; } + /** + * set custom host prefix and host name + * + * @param args: host prefix and host name + * @return + */ + private boolean setHost(JSONArray args) { + try { + String prefix = args.getString(0); + String name = args.getString(1); + AppsFlyerLib.getInstance().setHost(prefix, name); + Log.d("AppsFlyer", prefix + "." + name); + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + /** * takes string representation of a string array and converts it to an array. use this method because old version of cordova cannot pass an array to native. * newer versions can, but can break flow to older users diff --git a/src/ios/AppsFlyerPlugin.m b/src/ios/AppsFlyerPlugin.m index b8fd1372..0f26f2e4 100755 --- a/src/ios/AppsFlyerPlugin.m +++ b/src/ios/AppsFlyerPlugin.m @@ -740,6 +740,14 @@ - (void)setUseReceiptValidationSandbox:(CDVInvokedUrlCommand*)command { [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; } +- (void)setHost:(CDVInvokedUrlCommand*)command { + NSString* prefix = [command.arguments objectAtIndex:0]; + NSString* name = [command.arguments objectAtIndex:1]; + [[AppsFlyerLib shared] setHost:name withHostPrefix:prefix]; + NSLog(@"[DEBUG] AppsFlyer: %@.%@",prefix, name); + +} + @end diff --git a/www/appsflyer.js b/www/appsflyer.js index beaaffa4..5523675e 100644 --- a/www/appsflyer.js +++ b/www/appsflyer.js @@ -302,5 +302,14 @@ if (!window.CustomEvent) { AppsFlyer.prototype.setUserEmails = function (userEmails, successC) { exec(successC, null, 'AppsFlyerPlugin', 'setUserEmails', [userEmails]); }; + + /** + * Set a custom host + * @param hostPrefix + * @param hostName + */ + AppsFlyer.prototype.setHost = function (hostPrefix, hostName) { + exec(null, null, 'AppsFlyerPlugin', 'setHost', [hostPrefix, hostName]); + }; module.exports = new AppsFlyer(); })(window); From 6a783b931fe68d0e7aa49ad3b854f7ddfe7227bb Mon Sep 17 00:00:00 2001 From: Amit Date: Mon, 11 Jan 2021 12:51:55 +0200 Subject: [PATCH 4/6] make logEvent callback returns from the sdk --- docs/API.md | 6 ++++-- .../cordova/plugin/AppsFlyerPlugin.java | 13 +++++++++++-- src/ios/AppsFlyerPlugin.m | 18 ++++++++++++------ 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/docs/API.md b/docs/API.md index 0aa32b25..77f89ea3 100755 --- a/docs/API.md +++ b/docs/API.md @@ -100,8 +100,8 @@ to track ROI (Return on Investment) and LTV (Lifetime Value). | ----------- |-----------------------------|--------------| | `eventName` | `String` | custom event name, is presented in your dashboard. See the Event list [HERE](https://github.com/AppsFlyerSDK/cordova-plugin-appsflyer-sdk/blob/master/src/ios/AppsFlyerTracker.h) | | `eventValue` | `Object` | event details | -| `onSuccess` | `(message: string)=>void` | event details | -| `onError` | `(message: string)=>void` | event details | +| `onSuccess` | `function` | triggered when the event was sent successfully. returns the event's name. can be Null | +| `onError` | `function` | triggered when an error occurred. returns an error message. can be Null | *Example:* @@ -122,6 +122,8 @@ var eventValues = { }; window.plugins.appsFlyer.logEvent(eventName, eventValues, successTrackEvent, failureTrackEvent); +//OR +window.plugins.appsFlyer.logEvent(eventName, eventValues, null, null); ``` --- diff --git a/src/android/com/appsflyer/cordova/plugin/AppsFlyerPlugin.java b/src/android/com/appsflyer/cordova/plugin/AppsFlyerPlugin.java index a2e81ec2..80bdede8 100644 --- a/src/android/com/appsflyer/cordova/plugin/AppsFlyerPlugin.java +++ b/src/android/com/appsflyer/cordova/plugin/AppsFlyerPlugin.java @@ -376,8 +376,17 @@ private boolean logEvent(JSONArray parameters, final CallbackContext callbackCon } Context c = this.cordova.getActivity().getApplicationContext(); - AppsFlyerLib.getInstance().logEvent(c, eventName, eventValues); - callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, eventName)); + AppsFlyerLib.getInstance().logEvent(c, eventName, eventValues, callbackContext == null? null: new AppsFlyerRequestListener() { + @Override + public void onSuccess() { + callbackContext.success(eventName); + } + + @Override + public void onError(int i, String s) { + callbackContext.error(s); + } + }); return true; } diff --git a/src/ios/AppsFlyerPlugin.m b/src/ios/AppsFlyerPlugin.m index 0f26f2e4..841720de 100755 --- a/src/ios/AppsFlyerPlugin.m +++ b/src/ios/AppsFlyerPlugin.m @@ -234,12 +234,18 @@ - (void)logEvent:(CDVInvokedUrlCommand*)command { return; } - [[AppsFlyerLib shared] logEvent:eventName withValues:eventValues]; - - CDVPluginResult *pluginResult = [ CDVPluginResult resultWithStatus: CDVCommandStatus_OK - messageAsString:eventName - ]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; + [[AppsFlyerLib shared] logEventWithEventName:eventName eventValues:eventValues completionHandler:^(NSDictionary * _Nullable dictionary, NSError * _Nullable error) { + if(error != nil){ + CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString: [error localizedDescription]]; + [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; + return; + }else{ + CDVPluginResult *pluginResult = [ CDVPluginResult resultWithStatus: CDVCommandStatus_OK + messageAsString:eventName + ]; + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; + } + }]; } /** From f6d0c749a25e3bdd270e21eb37c88dfbaa4d1689 Mon Sep 17 00:00:00 2001 From: Amit Date: Mon, 11 Jan 2021 13:57:04 +0200 Subject: [PATCH 5/6] update DOCS and RELEASENOTES --- README.md | 51 ++++++++++++++++++++++---------------------- RELEASENOTES.md | 11 ++++++++++ docs/RELEASENOTES.md | 11 ++++++++++ 3 files changed, 48 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index adc6e54a..1946d917 100755 --- a/README.md +++ b/README.md @@ -145,7 +145,32 @@ Check out our Sample-App **Let's cook!** [here](https://github.com/AppsFlyerSDK So the latest version that can work with Ionic-Native for now is **5.4.30**
In case you are using Ionic framework, you have 2 options: -### 1 - Using Ionic native plugin +### 1. Using the `window` object directly +Install the cordova plugin: +``` +$ ionic cordova plugin add cordova-plugin-appsflyer-sdk +``` +In your main ts file, declare a window variable: +```javascript +declare var window; +``` +Now you can use the AppsFlyer plugin directly from cordova: +```javascript +import {Component} from '@angular/core'; +import {Platform} from '@ionic/angular'; + +declare var window; +... +export class HomePage { + constructor(public platform: Platform) { + this.platform.ready().then(() => { + window.plugins.appsFlyer.initSdk(options, success, error); + }); + } +} +``` + +### 2 - Using Ionic native plugin #### Ionic 4 run this commands: **With Cordova**: @@ -199,28 +224,4 @@ And finally in your main ts file: ``` import { Appsflyer } from '@ionic-native/appsflyer'; ``` -### 2. Using the `window` object directly -Install the cordova plugin: -``` -$ ionic cordova plugin add cordova-plugin-appsflyer-sdk -``` -In your main ts file, declare a window variable: -```javascript -declare var window; -``` -Now you can use the AppsFlyer plugin directly from cordova: -```javascript -import {Component} from '@angular/core'; -import {Platform} from '@ionic/angular'; - -declare var window; -... -export class HomePage { - constructor(public platform: Platform) { - this.platform.ready().then(() => { - window.plugins.appsFlyer.initSdk(options, success, error); - }); - } -} -``` Check out the full [API](/docs/API.md) for more information diff --git a/RELEASENOTES.md b/RELEASENOTES.md index f48980eb..8d4163e7 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,4 +1,15 @@ # Release Notes +### 6.1.30 +Release date **January 11, 2021** +Release type: Major / **Minor** / Hotfix + +**Overview and Highlights:** + +- iOS SDK 6.1.3 +- Android SDK 6.1.3 +- setHost api +- get in-App events callbacks from sdk + ### 6.1.20 Release date **December 16, 2020** Release type: Major / **Minor** / Hotfix diff --git a/docs/RELEASENOTES.md b/docs/RELEASENOTES.md index 0150eb8e..e636d89e 100755 --- a/docs/RELEASENOTES.md +++ b/docs/RELEASENOTES.md @@ -1,4 +1,15 @@ # Release Notes +### 6.1.30 +Release date **January 11, 2021** +Release type: Major / **Minor** / Hotfix + +**Overview and Highlights:** + +- iOS SDK 6.1.3 +- Android SDK 6.1.3 +- setHost api +- get in-App events callbacks from sdk + ### 6.1.20 Release date **December 16, 2020** Release type: Major / **Minor** / Hotfix From e6e8fd827deb217505e24d0fd588b3f6576565e3 Mon Sep 17 00:00:00 2001 From: Amit Date: Mon, 11 Jan 2021 14:58:01 +0200 Subject: [PATCH 6/6] addPushNotificationDeepLinkPath api --- RELEASENOTES.md | 1 + docs/API.md | 17 +++++++++++++++++ docs/RELEASENOTES.md | 1 + .../cordova/plugin/AppsFlyerPlugin.java | 17 +++++++++++++++-- src/ios/AppsFlyerPlugin.m | 10 ++++++++++ www/appsflyer.js | 9 +++++++++ 6 files changed, 53 insertions(+), 2 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 8d4163e7..98fd9ce2 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -8,6 +8,7 @@ Release type: Major / **Minor** / Hotfix - iOS SDK 6.1.3 - Android SDK 6.1.3 - setHost api +- addPushNotificationDeepLinkPath api - get in-App events callbacks from sdk ### 6.1.20 diff --git a/docs/API.md b/docs/API.md index 77f89ea3..f6248e9e 100755 --- a/docs/API.md +++ b/docs/API.md @@ -40,6 +40,7 @@ The list of available methods for this plugin is described below. | [`setUserEmails`](#setUserEmails) | `(emails, function success)` | Set user emails for FB Advanced Matching | | [`setPhoneNumber`](#setPhoneNumber) | `(String phoneNumber, function success)` | Set phone number for FB Advanced Matching | | [`setHost`](#setHost) | `(String hostPrefix, String hostName)` | Set custom host prefix and host name | +| [`addPushNotificationDeepLinkPath`](#addPushNotificationDeepLinkPath) | `(path)` | configure push notification deep link resolution | --- @@ -589,6 +590,22 @@ window.plugins.appsFlyer.setHost(prefix, name); | `hostPrefix` | `String` | host prefix | | `hostName` | `String` | host name | +--- +#####
**`addPushNotificationDeepLinkPath(path): void`** +The addPushNotificationDeepLinkPath method provides app owners with a flexible interface for configuring how deep links are extracted from push notification payloads. for more information: [here](https://support.appsflyer.com/hc/en-us/articles/207032126-Android-SDK-integration-for-developers#core-apis-65-configure-push-notification-deep-link-resolution) +❗Important❗ addPushNotificationDeepLinkPath must be called before calling initSDK + +*Example:* + +```javascript +let path = ["go", "to", "this", "path"] +window.plugins.appsFlyer.addPushNotificationDeepLinkPath(path); +``` + +| parameter | type | description | +| ----------- |-----------------------------|--------------| +| `path` | `String[]` | strings array of the path | + --- ### Deep linking Tracking diff --git a/docs/RELEASENOTES.md b/docs/RELEASENOTES.md index e636d89e..f86120e7 100755 --- a/docs/RELEASENOTES.md +++ b/docs/RELEASENOTES.md @@ -8,6 +8,7 @@ Release type: Major / **Minor** / Hotfix - iOS SDK 6.1.3 - Android SDK 6.1.3 - setHost api +- addPushNotificationDeepLinkPath api - get in-App events callbacks from sdk ### 6.1.20 diff --git a/src/android/com/appsflyer/cordova/plugin/AppsFlyerPlugin.java b/src/android/com/appsflyer/cordova/plugin/AppsFlyerPlugin.java index 80bdede8..ee906230 100644 --- a/src/android/com/appsflyer/cordova/plugin/AppsFlyerPlugin.java +++ b/src/android/com/appsflyer/cordova/plugin/AppsFlyerPlugin.java @@ -115,6 +115,8 @@ public boolean execute(final String action, JSONArray args, CallbackContext call return setUserEmails(args, callbackContext); } else if ("setHost".equals(action)) { return setHost(args); + } else if ("addPushNotificationDeepLinkPath".equals(action)) { + return addPushNotificationDeepLinkPath(args); } return false; @@ -376,7 +378,7 @@ private boolean logEvent(JSONArray parameters, final CallbackContext callbackCon } Context c = this.cordova.getActivity().getApplicationContext(); - AppsFlyerLib.getInstance().logEvent(c, eventName, eventValues, callbackContext == null? null: new AppsFlyerRequestListener() { + AppsFlyerLib.getInstance().logEvent(c, eventName, eventValues, callbackContext == null ? null : new AppsFlyerRequestListener() { @Override public void onSuccess() { callbackContext.success(eventName); @@ -975,6 +977,18 @@ private boolean setHost(JSONArray args) { return true; } + private boolean addPushNotificationDeepLinkPath(JSONArray args) { + try { + String pathStr = args.getString(0); + String[] path = stringToArray(pathStr); + AppsFlyerLib.getInstance().addPushNotificationDeepLinkPath(path); + Log.d("AppsFlyer", path.toString()); + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } + /** * takes string representation of a string array and converts it to an array. use this method because old version of cordova cannot pass an array to native. * newer versions can, but can break flow to older users @@ -986,7 +1000,6 @@ private String[] stringToArray(String str) { String[] realArr = null; str = str.substring(1, str.length() - 1); str = str.replaceAll(" ", ""); - realArr = str.split("[ ,]"); for (String el : realArr) { el = el.substring(1, el.length() - 1); diff --git a/src/ios/AppsFlyerPlugin.m b/src/ios/AppsFlyerPlugin.m index 841720de..78610684 100755 --- a/src/ios/AppsFlyerPlugin.m +++ b/src/ios/AppsFlyerPlugin.m @@ -754,6 +754,16 @@ - (void)setHost:(CDVInvokedUrlCommand*)command { } +- (void)addPushNotificationDeepLinkPath:(CDVInvokedUrlCommand*)command { + NSArray* path = command.arguments; + if (path.count == 0) { + return; + } + [[AppsFlyerLib shared] addPushNotificationDeepLinkPath:path]; + NSLog(@"[DEBUG] AppsFlyer: %@", path); + +} + @end diff --git a/www/appsflyer.js b/www/appsflyer.js index 5523675e..12cba2ce 100644 --- a/www/appsflyer.js +++ b/www/appsflyer.js @@ -311,5 +311,14 @@ if (!window.CustomEvent) { AppsFlyer.prototype.setHost = function (hostPrefix, hostName) { exec(null, null, 'AppsFlyerPlugin', 'setHost', [hostPrefix, hostName]); }; + + /** + * 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 + */ + AppsFlyer.prototype.addPushNotificationDeepLinkPath = function (path) { + exec(null, null, 'AppsFlyerPlugin', 'addPushNotificationDeepLinkPath', [path]); + }; module.exports = new AppsFlyer(); })(window);