diff --git a/.migration_backup/package.json b/.migration_backup/package.json
index 6d9520c6..975a852b 100644
--- a/.migration_backup/package.json
+++ b/.migration_backup/package.json
@@ -1,6 +1,6 @@
{
"name": "nativescript-plugin-appsflyer",
- "version": "6.12.1",
+ "version": "6.13.0",
"description": "Appsflyer SDK for NativeScript applications",
"main": "appsflyer",
"typings": "index.d.ts",
diff --git a/README.md b/README.md
index a9ecade5..4d609cfb 100644
--- a/README.md
+++ b/README.md
@@ -21,8 +21,8 @@
## This plugin is built for
-- iOS AppsFlyerSDK **v6.12.0**
-- Android AppsFlyerSDK **v6.12.1**
+- iOS AppsFlyerSDK **v6.13.0**
+- Android AppsFlyerSDK **v6.13.0**
## Breaking Changes
diff --git a/appsflyer.android.d.ts b/appsflyer.android.d.ts
index 89d75d36..72e4992c 100644
--- a/appsflyer.android.d.ts
+++ b/appsflyer.android.d.ts
@@ -1,11 +1,17 @@
-import { InitSDKOptions, LogEventOptions } from './index';
-export declare const initSdk: (args: InitSDKOptions) => Promise;
-export declare const logEvent: (args: LogEventOptions) => Promise;
-export declare const setCustomerUserId: (userId: string) => Promise;
-export declare const setAppInviteOneLink: (link: string) => Promise;
-export declare const generateInviteUrl: (args: AppsFlyerLinkGeneratorArgs) => Promise;
-export declare const stop: (isStopped: bool) => Promise;
-export declare const setSharingFilter: (partners: Array) => Promise;
-export declare const setSharingFilterForAllPartners: () => Promise;
-export declare const _toHashMap: (obj: Object) => javautilHashMap;
-export declare const _toValue: (val: any) => any;
+import { InitSDKOptions, LogEventOptions, AppsFlyerLinkGeneratorArgs , AppsFlyerConsentArgs } from './index';
+declare const initSdk: (args: InitSDKOptions) => Promise;
+declare const startSdk: () => void;
+declare const logEvent: (args: LogEventOptions) => Promise;
+declare const setCustomerUserId: (userId: string) => Promise;
+declare const setAppInviteOneLink: (link: string) => Promise;
+declare const generateInviteUrl: (args: AppsFlyerLinkGeneratorArgs) => Promise;
+declare const enableTCFDataCollection: (shouldCollect: boolean) => Promise;
+declare const setConsentData: (consent: AppsFlyerConsentArgs) => Promise;
+declare const getAppsFlyerUID: () => string;
+declare const stop: (isStopped: boolean) => Promise;
+declare const setSharingFilter: (partners: Array) => Promise;
+declare const setSharingFilterForAllPartners: () => Promise;
+declare const _toHashMap: (obj: Object) => javautilHashMap;
+declare const _toValue: (val: any) => any;
+export { initSdk, startSdk, logEvent, stop, setCustomerUserId, setAppInviteOneLink, generateInviteUrl, getAppsFlyerUID, enableTCFDataCollection, setConsentData,setSharingFilter,setSharingFilterForAllPartners,_toHashMap ,_toValue};
+
diff --git a/appsflyer.android.ts b/appsflyer.android.ts
index 7dcaa239..1d3cd2f2 100644
--- a/appsflyer.android.ts
+++ b/appsflyer.android.ts
@@ -1,10 +1,7 @@
// @ts-nocheck
-import { Application, Utils } from "@nativescript/core";
+import { Application, Utils } from "@nativescript/core";
-import {
- InitSDKOptions,
- LogEventOptions,
-} from './index';
+import { InitSDKOptions, LogEventOptions } from "./index";
const stringSetToStringArray = Utils.ad.collections.stringSetToStringArray;
@@ -12,323 +9,431 @@ let _isDebugLocal = false;
let _appsFlyerConversionListener = undefined;
let _appsFlyerRequestListener = undefined;
-export const initSdk = function (args: InitSDKOptions) {
-
- return new Promise(function (resolve, reject) {
- try {
- if (typeof(com.appsflyer.AppsFlyerLib) !== "undefined") {
-
- const appsFlyerLibInstance = com.appsflyer.AppsFlyerLib.getInstance();
-
- _isDebugLocal = args.isDebug;
-
- appsFlyerLibInstance.setDebugLog(_isDebugLocal);
-
- if (args.onConversionDataSuccess || args.onConversionDataFail) {
+const initSdk = function (args: InitSDKOptions) {
+ return new Promise(function (resolve, reject) {
+ try {
+ if (typeof com.appsflyer.AppsFlyerLib !== "undefined") {
+ const appsFlyerLibInstance = com.appsflyer.AppsFlyerLib.getInstance();
+
+ _isDebugLocal = args.isDebug;
+
+ appsFlyerLibInstance.setDebugLog(_isDebugLocal);
+
+ if (args.onConversionDataSuccess || args.onConversionDataFail) {
+ try {
+ _appsFlyerConversionListener =
+ new com.appsflyer.AppsFlyerConversionListener({
+ _gcdSuccessCallback: args.onConversionDataSuccess,
+ _gcdFailureCallback: args.onConversionDataFail,
+ _oaoaSuccessCallback: args.onAppOpenAttribution,
+ _oaoaFailureCallback: args.onAppOpenAttributionFailure,
+
+ onConversionDataSuccess(
+ conversionData: java.util.Map
+ ): void {
+ if (!this._gcdSuccessCallback) {
+ return;
+ }
+ if (typeof this._gcdSuccessCallback === "function") {
try {
- _appsFlyerConversionListener = new com.appsflyer.AppsFlyerConversionListener({
- _gcdSuccessCallback: args.onConversionDataSuccess,
- _gcdFailureCallback: args.onConversionDataFail,
- _oaoaSuccessCallback: args.onAppOpenAttribution,
- _oaoaFailureCallback: args.onAppOpenAttributionFailure,
-
- onConversionDataSuccess(conversionData: java.util.Map): void {
- if (!this._gcdSuccessCallback) {
- return;
- }
- if (typeof this._gcdSuccessCallback === 'function') {
- try {
- const data = {};
- for (const key of stringSetToStringArray(conversionData.keySet())) {
- data[key] = conversionData.get(key);
- }
- this._gcdSuccessCallback(data);
- printLogs("onConversionDataSuccess: " + JSON.stringify(args));
- } catch (e) {
- printLogs(`onConversionDataSuccess Error: ${e}`);
- }
- } else {
- printLogs(`onConversionDataSuccess: callback is not a function`);
- }
- },
- onConversionDataFail(error: string): void {
- if (!this._gcdFailureCallback) {
- return;
- }
- if (typeof this._gcdFailureCallback === 'function') {
- try {
- this._gcdFailureCallback(error);
- printLogs("onConversionDataFail error: " + error);
- } catch (e) {
- printLogs(`onConversionDataFail Error: ${e}`);
- }
- } else {
- printLogs("onConversionDataFail: callback is not a function");
- }
- },
- onAttributionFailure(error: string): void {
- if (!this._oaoaFailureCallback) {
- return;
- }
- if (typeof this._oaoaFailureCallback === 'function') {
- try {
- this._oaoaFailureCallback(error);
- printLogs("onAttributionFailure error: " + error);
- } catch (e) {
- printLogs(`onAttributionFailure Error: ${e}`);
- }
- } else {
- printLogs("onAttributionFailure: callback is not a function");
- }
- },
- onAppOpenAttribution(onAppOpenAttributionData: java.util.Map): void {
- if (!this._oaoaSuccessCallback) {
- return;
- }
- if (typeof this._oaoaSuccessCallback === 'function') {
- try {
- let data = {};
- for (const key of stringSetToStringArray(onAppOpenAttributionData.keySet())) {
- data[key] = onAppOpenAttributionData.get(key);
- }
-
- printLogs("onAppOpenAttribution: " + JSON.stringify(data));
- } catch (e) {
- printLogs(`onAppOpenAttribution Error: ${e}`);
- }
- } else {
- printLogs(`onAppOpenAttribution: callback is not a function`);
- }
- },
- });
+ const data = {};
+ for (const key of stringSetToStringArray(
+ conversionData.keySet()
+ )) {
+ data[key] = conversionData.get(key);
+ }
+ this._gcdSuccessCallback(data);
+ printLogs(
+ "onConversionDataSuccess: " + JSON.stringify(args)
+ );
} catch (e) {
- printLogs(`registerConversionListener Error:${e}`);
+ printLogs(`onConversionDataSuccess Error: ${e}`);
}
- }
-
- if(args.onDeepLinking){
- try{
- appsFlyerLibInstance.subscribeForDeepLink(new com.appsflyer.deeplink.DeepLinkListener({
- _onDeepLinkingCallback: args.onDeepLinking,
- onDeepLinking(deepLinkResult: Object): void {
- printLogs(`DeepLinkResult: ${deepLinkResult.toString()}`);
- this._onDeepLinkingCallback(deepLinkResult);
+ } else {
+ printLogs(
+ `onConversionDataSuccess: callback is not a function`
+ );
+ }
+ },
+ onConversionDataFail(error: string): void {
+ if (!this._gcdFailureCallback) {
+ return;
+ }
+ if (typeof this._gcdFailureCallback === "function") {
+ try {
+ this._gcdFailureCallback(error);
+ printLogs("onConversionDataFail error: " + error);
+ } catch (e) {
+ printLogs(`onConversionDataFail Error: ${e}`);
+ }
+ } else {
+ printLogs(
+ "onConversionDataFail: callback is not a function"
+ );
+ }
+ },
+ onAttributionFailure(error: string): void {
+ if (!this._oaoaFailureCallback) {
+ return;
+ }
+ if (typeof this._oaoaFailureCallback === "function") {
+ try {
+ this._oaoaFailureCallback(error);
+ printLogs("onAttributionFailure error: " + error);
+ } catch (e) {
+ printLogs(`onAttributionFailure Error: ${e}`);
+ }
+ } else {
+ printLogs(
+ "onAttributionFailure: callback is not a function"
+ );
+ }
+ },
+ onAppOpenAttribution(
+ onAppOpenAttributionData: java.util.Map
+ ): void {
+ if (!this._oaoaSuccessCallback) {
+ return;
+ }
+ if (typeof this._oaoaSuccessCallback === "function") {
+ try {
+ let data = {};
+ for (const key of stringSetToStringArray(
+ onAppOpenAttributionData.keySet()
+ )) {
+ data[key] = onAppOpenAttributionData.get(key);
}
- }));
- } catch(e){
- printLogs(`onDeepLinking Error: ${e}`);
+
+ printLogs(
+ "onAppOpenAttribution: " + JSON.stringify(data)
+ );
+ } catch (e) {
+ printLogs(`onAppOpenAttribution Error: ${e}`);
+ }
+ } else {
+ printLogs(
+ `onAppOpenAttribution: callback is not a function`
+ );
}
- }
-
- const platform_extension = com.appsflyer.internal.platform_extension;
- const pluginInfoClass = new platform_extension.PluginInfo(platform_extension.Plugin.NATIVE_SCRIPT, "6.12.1", new java.util.HashMap());
- appsFlyerLibInstance.setPluginInfo(pluginInfoClass);
-
- appsFlyerLibInstance.init(args.devKey,_appsFlyerConversionListener,(Application.android.context || (com).tns.NativeScriptApplication.getInstance()));
-
- _start(appsFlyerLibInstance);
-
- appsFlyerLibInstance.start((com).tns.NativeScriptApplication.getInstance());
-
- resolve({status: "success"});
- } else {
- reject({status: "failure", message: "com.appsflyer.AppsFlyerLib is not defined"});
- }
- } catch (ex) {
- printLogs("Error: " + ex);
- reject(ex);
+ },
+ });
+ } catch (e) {
+ printLogs(`registerConversionListener Error:${e}`);
+ }
}
- });
-};
-
-function _start (_instance: com.appsflyer.AppsFlyerLib) {
- printLogs("start is called");
-
- const c = Application.android.context || (com).tns.NativeScriptApplication.getInstance();
- _instance.logEvent(c, null, null);
-}
-
-export const logEvent = function (args: LogEventOptions) {
- return new Promise(function (resolve, reject) {
- try {
- if (args.onSuccess || args.onError) {
- try {
- _appsFlyerRequestListener = new com.appsflyer.attribution.AppsFlyerRequestListener({
- _successCallback: args.onSuccess,
- _failureCallback: args.onError,
- onSuccess(): void {
- if (!this._successCallback) {
- return;
- }
- if (typeof this._successCallback === 'function') {
- try {
- this._successCallback(args);
- printLogs("logEvent success: " + JSON.stringify(args));
- } catch (e) {
- printLogs(`onLogEventRequestSuccess Error: ${e}`);
- }
- } else {
- printLogs(`onLogEventRequestSuccess: callback is not a function`);
- }
- resolve({status: args});
- },
- onError(error: string): void {
- if (!this._failureCallback) {
- return;
- }
- if (typeof this._failureCallback === 'function') {
- try {
- this._failureCallback(error);
- printLogs("logEvent error: " + error);
- } catch (e) {
- printLogs(`onLogEventRequestFailure Error: ${e}`);
- }
- } else {
- printLogs(`onLogRequestFailure: callback is not a function`);
- }
- resolve({status: "failure"});
- },
- });
- } catch (e) {
- printLogs(`AppsFlyerRequestListener Error:${e}`);
-
- }
- }
- const appsFlyerLibInstance = com.appsflyer.AppsFlyerLib.getInstance();
- const c = Application.android.context || (com).tns.NativeScriptApplication.getInstance();
- appsFlyerLibInstance.logEvent(c, args.eventName, _toValue(args.eventValues), _appsFlyerRequestListener);
-
-
- } catch (ex) {
- printLogs("Error: " + ex);
- reject(ex);
+ if (args.onDeepLinking) {
+ try {
+ appsFlyerLibInstance.subscribeForDeepLink(
+ new com.appsflyer.deeplink.DeepLinkListener({
+ _onDeepLinkingCallback: args.onDeepLinking,
+ onDeepLinking(deepLinkResult: Object): void {
+ printLogs(`DeepLinkResult: ${deepLinkResult.toString()}`);
+ this._onDeepLinkingCallback(deepLinkResult);
+ },
+ })
+ );
+ } catch (e) {
+ printLogs(`onDeepLinking Error: ${e}`);
+ }
}
- });
-};
-export const setCustomerUserId = function (userId: string) {
-
- return new Promise(function (resolve, reject) {
- try {
- const appsFlyerLibInstance = com.appsflyer.AppsFlyerLib.getInstance();
- appsFlyerLibInstance.setCustomerUserId(userId);
-
- resolve({status: "success"});
- } catch (ex) {
- printLogs("setCustomerUserId Error: " + ex);
- reject(ex);
+ const platform_extension = com.appsflyer.internal.platform_extension;
+ const pluginInfoClass = new platform_extension.PluginInfo(
+ platform_extension.Plugin.NATIVE_SCRIPT,
+ "6.13.0",
+ new java.util.HashMap()
+ );
+ appsFlyerLibInstance.setPluginInfo(pluginInfoClass);
+
+ appsFlyerLibInstance.init(
+ args.devKey,
+ _appsFlyerConversionListener,
+ Application.android.context ||
+ (com).tns.NativeScriptApplication.getInstance()
+ );
+
+ const shouldManuallyStart = args.manualStart === true;
+ if (!shouldManuallyStart) {
+ startSdk();
}
- });
-};
-
-export const setAppInviteOneLink = function (link: string) {
-
- return new Promise(function (resolve, reject) {
- try {
- const appsFlyerLibInstance = com.appsflyer.AppsFlyerLib.getInstance();
- appsFlyerLibInstance.setAppInviteOneLink(link);
- resolve({status: "success"});
- } catch (ex) {
- printLogs("setAppInviteOneLink Error: " + ex);
- reject(ex);
- }
- });
+ resolve({ status: "success" });
+ } else {
+ reject({
+ status: "failure",
+ message: "com.appsflyer.AppsFlyerLib is not defined",
+ });
+ }
+ } catch (ex) {
+ printLogs("Error: " + ex);
+ reject(ex);
+ }
+ });
};
-export const generateInviteUrl = function (args: AppsFlyerLinkGeneratorArgs) {
+const startSdk = function () {
+ const appsFlyerLibInstance = com.appsflyer.AppsFlyerLib.getInstance();
+ _start(appsFlyerLibInstance);
+ appsFlyerLibInstance.start(
+ (com).tns.NativeScriptApplication.getInstance()
+ );
+};
- return new Promise(function (resolve, reject) {
- try {
- const params = args.params;
- const channel: String = params.channel;
- const campaign: String = params.campaign;
- const referrerName: String = params.referrerName;
- const referrerImageUrl: String = params.referrerImageUrl;
- const customerID: String = params.customerID;
- const baseDeepLink: String = params.baseDeepLink;
- const brandDomain: String = params.brandDomain;
-
- const appsflyerShareInviteHelper: com.appsflyer.share.ShareInviteHelper = com.appsflyer.share.ShareInviteHelper;
- const linkGenerator: com.appsflyer.share.LinkGenerator = appsflyerShareInviteHelper.generateInviteUrl(Application.android.context);
-
- if (channel != null && channel != "") {
- linkGenerator.setChannel(String(channel));
- }
- if (campaign != null && campaign != "") {
- linkGenerator.setCampaign(String(campaign));
- }
- if (referrerName != null && referrerName != "") {
- linkGenerator.setReferrerName(String(referrerName));
- }
- if (referrerImageUrl != null && referrerImageUrl != "") {
- linkGenerator.setReferrerImageURL(String(referrerImageUrl));
- }
- if (customerID != null && customerID != "") {
- linkGenerator.setReferrerCustomerId(String(customerID));
- }
- if (baseDeepLink != null && baseDeepLink != "") {
- linkGenerator.setBaseDeeplink(String(baseDeepLink));
- }
- if (brandDomain != null && brandDomain != "") {
- linkGenerator.setBrandDomain(String(brandDomain));
- }
+function _start(_instance: com.appsflyer.AppsFlyerLib) {
+ printLogs("start is called");
- if (!isEmpty(params.userParams)) {
- Object.entries(params.userParams).forEach(([key, value]) => {
- linkGenerator.addParameter(key, String(value));
- })
- }
+ const c =
+ Application.android.context ||
+ (com).tns.NativeScriptApplication.getInstance();
+ _instance.logEvent(c, null, null);
+}
- if(args.onSuccess && args.onError){
- const listener: com.appsflyer.CreateOneLinkHttpTask.ResponseListener = new com.appsflyer.CreateOneLinkHttpTask.ResponseListener({
+const logEvent = function (args: LogEventOptions) {
+ return new Promise(function (resolve, reject) {
+ try {
+ if (args.onSuccess || args.onError) {
+ try {
+ _appsFlyerRequestListener =
+ new com.appsflyer.attribution.AppsFlyerRequestListener({
_successCallback: args.onSuccess,
_failureCallback: args.onError,
- onResponse(): void {
+ onSuccess(): void {
if (!this._successCallback) {
return;
}
- if (typeof this._successCallback === 'function') {
+ if (typeof this._successCallback === "function") {
try {
this._successCallback(args);
- printLogs("generateInviteUrl success: " + JSON.stringify(args));
+ printLogs("logEvent success: " + JSON.stringify(args));
} catch (e) {
- printLogs(`generateInviteUrl Error: ${e}`);
+ printLogs(`onLogEventRequestSuccess Error: ${e}`);
}
} else {
- printLogs(`generateInviteUrl: callback is not a function`);
+ printLogs(
+ `onLogEventRequestSuccess: callback is not a function`
+ );
}
- resolve({status: args});
+ resolve({ status: args });
},
- onResponseError(error: string): void {
+ onError(error: string): void {
if (!this._failureCallback) {
return;
}
- if (typeof this._failureCallback === 'function') {
+ if (typeof this._failureCallback === "function") {
try {
this._failureCallback(error);
- printLogs("generateInviteUrl error: " + error);
+ printLogs("logEvent error: " + error);
} catch (e) {
- printLogs(`generateInviteUrl Error: ${e}`);
+ printLogs(`onLogEventRequestFailure Error: ${e}`);
}
} else {
- printLogs(`generateInviteUrl: callback is not a function`);
+ printLogs(`onLogRequestFailure: callback is not a function`);
}
- resolve({status: "failure"});
+ resolve({ status: "failure" });
},
});
+ } catch (e) {
+ printLogs(`AppsFlyerRequestListener Error:${e}`);
+ }
+ }
+ const appsFlyerLibInstance = com.appsflyer.AppsFlyerLib.getInstance();
+ const c =
+ Application.android.context ||
+ (com).tns.NativeScriptApplication.getInstance();
+ appsFlyerLibInstance.logEvent(
+ c,
+ args.eventName,
+ _toValue(args.eventValues),
+ _appsFlyerRequestListener
+ );
+ } catch (ex) {
+ printLogs("Error: " + ex);
+ reject(ex);
+ }
+ });
+};
- linkGenerator.generateLink(Application.android.context, listener);
- }
-
+const getAppsFlyerUID = function () {
+ try {
+ const appsFlyerLibInstance = com.appsflyer.AppsFlyerLib.getInstance();
+ const uid: string = appsFlyerLibInstance.getAppsFlyerUID(
+ Utils.android.getApplicationContext()
+ );
+ return uid;
+ } catch (error) {
+ throw new Error("Failed to get AppsFlyer UID: " + error.message);
+ }
+};
- resolve({status: "success"});
- } catch (ex) {
- printLogs("generateInviteUrl Error: " + ex);
- reject(ex);
- }
- });
+const setCustomerUserId = function (userId: string) {
+ return new Promise(function (resolve, reject) {
+ try {
+ const appsFlyerLibInstance = com.appsflyer.AppsFlyerLib.getInstance();
+ appsFlyerLibInstance.setCustomerUserId(userId);
+
+ resolve({ status: "success" });
+ } catch (ex) {
+ printLogs("setCustomerUserId Error: " + ex);
+ reject(ex);
+ }
+ });
+};
+
+const enableTCFDataCollection = function (shouldCollect: boolean) {
+ return new Promise(function (resolve, reject) {
+ try {
+ const appsFlyerLibInstance = com.appsflyer.AppsFlyerLib.getInstance();
+ appsFlyerLibInstance.enableTCFDataCollection(shouldCollect);
+
+ resolve({ status: "success" });
+ } catch (ex) {
+ printLogs("enableTCFDataCollection Error: " + ex);
+ reject(ex);
+ }
+ });
+};
+
+const setConsentData = function (consent) {
+ return new Promise((resolve, reject) => {
+ try {
+ const appsFlyerLibInstance = com.appsflyer.AppsFlyerLib.getInstance();
+ let consentData;
+
+ if (consent.isUserSubjectToGDPR) {
+ // Provide default values for booleans if not defined
+ const hasConsentForDataUsage = consent.hasConsentForDataUsage === true;
+ const hasConsentForAdsPersonalization = consent.hasConsentForAdsPersonalization === true;
+
+ consentData = com.appsflyer.AppsFlyerConsent.forGDPRUser(
+ hasConsentForDataUsage,
+ hasConsentForAdsPersonalization
+ );
+ } else {
+ consentData = com.appsflyer.AppsFlyerConsent.forNonGDPRUser();
+ }
+
+ appsFlyerLibInstance.setConsentData(consentData);
+
+ resolve({ status: "success" });
+ } catch (ex) {
+ console.error(`Error setting consent data: ${ex.message}`);
+ reject(new Error(`Error setting consent data: ${ex.message}`));
+ }
+ });
+};
+
+const setAppInviteOneLink = function (link: string) {
+ return new Promise(function (resolve, reject) {
+ try {
+ const appsFlyerLibInstance = com.appsflyer.AppsFlyerLib.getInstance();
+ appsFlyerLibInstance.setAppInviteOneLink(link);
+
+ resolve({ status: "success" });
+ } catch (ex) {
+ printLogs("setAppInviteOneLink Error: " + ex);
+ reject(ex);
+ }
+ });
+};
+
+const generateInviteUrl = function (args: AppsFlyerLinkGeneratorArgs) {
+ return new Promise(function (resolve, reject) {
+ try {
+ const params = args.params;
+ const channel: String = params.channel;
+ const campaign: String = params.campaign;
+ const referrerName: String = params.referrerName;
+ const referrerImageUrl: String = params.referrerImageUrl;
+ const customerID: String = params.customerID;
+ const baseDeepLink: String = params.baseDeepLink;
+ const brandDomain: String = params.brandDomain;
+
+ const appsflyerShareInviteHelper: com.appsflyer.share.ShareInviteHelper =
+ com.appsflyer.share.ShareInviteHelper;
+ const linkGenerator: com.appsflyer.share.LinkGenerator =
+ appsflyerShareInviteHelper.generateInviteUrl(
+ Application.android.context
+ );
+
+ if (channel != null && channel != "") {
+ linkGenerator.setChannel(String(channel));
+ }
+ if (campaign != null && campaign != "") {
+ linkGenerator.setCampaign(String(campaign));
+ }
+ if (referrerName != null && referrerName != "") {
+ linkGenerator.setReferrerName(String(referrerName));
+ }
+ if (referrerImageUrl != null && referrerImageUrl != "") {
+ linkGenerator.setReferrerImageURL(String(referrerImageUrl));
+ }
+ if (customerID != null && customerID != "") {
+ linkGenerator.setReferrerCustomerId(String(customerID));
+ }
+ if (baseDeepLink != null && baseDeepLink != "") {
+ linkGenerator.setBaseDeeplink(String(baseDeepLink));
+ }
+ if (brandDomain != null && brandDomain != "") {
+ linkGenerator.setBrandDomain(String(brandDomain));
+ }
+
+ if (!isEmpty(params.userParams)) {
+ Object.entries(params.userParams).forEach(([key, value]) => {
+ linkGenerator.addParameter(key, String(value));
+ });
+ }
+
+ if (args.onSuccess && args.onError) {
+ const listener: com.appsflyer.CreateOneLinkHttpTask.ResponseListener =
+ new com.appsflyer.CreateOneLinkHttpTask.ResponseListener({
+ _successCallback: args.onSuccess,
+ _failureCallback: args.onError,
+ onResponse(): void {
+ if (!this._successCallback) {
+ return;
+ }
+ if (typeof this._successCallback === "function") {
+ try {
+ this._successCallback(args);
+ printLogs(
+ "generateInviteUrl success: " + JSON.stringify(args)
+ );
+ } catch (e) {
+ printLogs(`generateInviteUrl Error: ${e}`);
+ }
+ } else {
+ printLogs(`generateInviteUrl: callback is not a function`);
+ }
+ resolve({ status: args });
+ },
+ onResponseError(error: string): void {
+ if (!this._failureCallback) {
+ return;
+ }
+ if (typeof this._failureCallback === "function") {
+ try {
+ this._failureCallback(error);
+ printLogs("generateInviteUrl error: " + error);
+ } catch (e) {
+ printLogs(`generateInviteUrl Error: ${e}`);
+ }
+ } else {
+ printLogs(`generateInviteUrl: callback is not a function`);
+ }
+ resolve({ status: "failure" });
+ },
+ });
+
+ linkGenerator.generateLink(Application.android.context, listener);
+ }
+
+ resolve({ status: "success" });
+ } catch (ex) {
+ printLogs("generateInviteUrl Error: " + ex);
+ reject(ex);
+ }
+ });
};
function isEmpty(obj) {
for (const prop in obj) {
@@ -339,108 +444,131 @@ function isEmpty(obj) {
return true;
}
-export const stop = function (isStopped: bool) {
-
- return new Promise(function (resolve, reject) {
- try {
- const appsFlyerLibInstance = com.appsflyer.AppsFlyerLib.getInstance();
- appsFlyerLibInstance.stop(isStopped, Application.android.context);
-
- resolve({status: "success"});
- } catch (ex) {
- printLogs("stop Error: " + ex);
- reject(ex);
- }
- });
+const stop = function (isStopped: bool) {
+ return new Promise(function (resolve, reject) {
+ try {
+ const appsFlyerLibInstance = com.appsflyer.AppsFlyerLib.getInstance();
+ appsFlyerLibInstance.stop(isStopped, Application.android.context);
+
+ resolve({ status: "success" });
+ } catch (ex) {
+ printLogs("stop Error: " + ex);
+ reject(ex);
+ }
+ });
};
-export const setSharingFilter = function (partners: Array) {
-
+const setSharingFilter = function (partners: Array) {
return new Promise(function (resolve, reject) {
- try {
- const appsFlyerLibInstance = com.appsflyer.AppsFlyerLib.getInstance();
- appsFlyerLibInstance.setSharingFilter(partners);
-
- resolve({status: "success"});
- } catch (ex) {
- printLogs("setSharingFilter Error: " + ex);
- reject(ex);
- }
+ try {
+ const appsFlyerLibInstance = com.appsflyer.AppsFlyerLib.getInstance();
+ appsFlyerLibInstance.setSharingFilter(partners);
+
+ resolve({ status: "success" });
+ } catch (ex) {
+ printLogs("setSharingFilter Error: " + ex);
+ reject(ex);
+ }
});
};
-export const setSharingFilterForAllPartners = function () {
-
+const setSharingFilterForAllPartners = function () {
return new Promise(function (resolve, reject) {
- try {
- const appsFlyerLibInstance = com.appsflyer.AppsFlyerLib.getInstance();
- appsFlyerLibInstance.setSharingFilterForAllPartners();
-
- resolve({status: "success"});
- } catch (ex) {
- printLogs("setSharingFilterForAllPartners Error: " + ex);
- reject(ex);
- }
+ try {
+ const appsFlyerLibInstance = com.appsflyer.AppsFlyerLib.getInstance();
+ appsFlyerLibInstance.setSharingFilterForAllPartners();
+
+ resolve({ status: "success" });
+ } catch (ex) {
+ printLogs("setSharingFilterForAllPartners Error: " + ex);
+ reject(ex);
+ }
});
};
-export const _toHashMap = function(obj: Object) {
- const node = new java.util.HashMap();
- for (const property in obj) {
- if (obj.hasOwnProperty(property)) {
- if (obj[property] !== null) {
- switch (typeof obj[property]) {
- case 'object':
- // note: since this function has no second argument,
- // it appears the "node" being passed in this recursive call is unused
- // TypeScript detected this, so commenting out for now
- node.put(property, _toHashMap(obj[property]/*, node*/));
- break;
- case 'boolean':
- node.put(property, java.lang.Boolean.valueOf(String(obj[property])));
- break;
- case 'number':
- if (Number(obj[property]) === obj[property] && obj[property] % 1 === 0) {
- node.put(property, java.lang.Long.valueOf(String(obj[property])));
- } else {
- node.put(property, java.lang.Double.valueOf(String(obj[property])));
- }
- break;
- case 'string':
- node.put(property, String(obj[property]));
- break;
- }
+const _toHashMap = function (obj: Object) {
+ const node = new java.util.HashMap();
+ for (const property in obj) {
+ if (obj.hasOwnProperty(property)) {
+ if (obj[property] !== null) {
+ switch (typeof obj[property]) {
+ case "object":
+ // note: since this function has no second argument,
+ // it appears the "node" being passed in this recursive call is unused
+ // TypeScript detected this, so commenting out for now
+ node.put(property, _toHashMap(obj[property] /*, node*/));
+ break;
+ case "boolean":
+ node.put(
+ property,
+ java.lang.Boolean.valueOf(String(obj[property]))
+ );
+ break;
+ case "number":
+ if (
+ Number(obj[property]) === obj[property] &&
+ obj[property] % 1 === 0
+ ) {
+ node.put(property, java.lang.Long.valueOf(String(obj[property])));
+ } else {
+ node.put(
+ property,
+ java.lang.Double.valueOf(String(obj[property]))
+ );
}
+ break;
+ case "string":
+ node.put(property, String(obj[property]));
+ break;
}
+ }
}
- return node;
+ }
+ return node;
};
-export const _toValue = function(val: any){
- let returnVal = null;
- if (val !== null) {
- switch (typeof val) {
- case 'object':
- returnVal = _toHashMap(val);
- break;
- case 'boolean':
- returnVal = java.lang.Boolean.valueOf(String(val));
- break;
- case 'number':
- if (Number(val) === val && val % 1 === 0) {
- returnVal = java.lang.Long.valueOf(String(val));
- } else {
- returnVal = java.lang.Double.valueOf(String(val));
- }
- break;
- case 'string':
- returnVal = String(val);
- break;
+const _toValue = function (val: any) {
+ let returnVal = null;
+ if (val !== null) {
+ switch (typeof val) {
+ case "object":
+ returnVal = _toHashMap(val);
+ break;
+ case "boolean":
+ returnVal = java.lang.Boolean.valueOf(String(val));
+ break;
+ case "number":
+ if (Number(val) === val && val % 1 === 0) {
+ returnVal = java.lang.Long.valueOf(String(val));
+ } else {
+ returnVal = java.lang.Double.valueOf(String(val));
}
+ break;
+ case "string":
+ returnVal = String(val);
+ break;
}
- return returnVal;
+ }
+ return returnVal;
};
-function printLogs(logs){
- if (_isDebugLocal) {
- console.log("AppsFlyer :: " + logs);
- }
-}
\ No newline at end of file
+function printLogs(logs) {
+ if (_isDebugLocal) {
+ console.log("AppsFlyer :: " + logs);
+ }
+}
+
+export {
+ initSdk,
+ startSdk,
+ logEvent,
+ stop,
+ setCustomerUserId,
+ setAppInviteOneLink,
+ generateInviteUrl,
+ getAppsFlyerUID,
+ enableTCFDataCollection,
+ setConsentData,
+ setSharingFilter,
+ setSharingFilterForAllPartners,
+ _toHashMap,
+ _toValue,
+};
diff --git a/appsflyer.ios.d.ts b/appsflyer.ios.d.ts
index 43ae253b..7df11223 100644
--- a/appsflyer.ios.d.ts
+++ b/appsflyer.ios.d.ts
@@ -1,8 +1,12 @@
-import { InitSDKOptions, LogEventOptions } from './index';
+import { InitSDKOptions, LogEventOptions , AppsFlyerLinkGeneratorArgs, AppsFlyerConsentArgs} from './index';
declare const initSdk: (args: InitSDKOptions) => Promise;
+declare const startSdk: () => void;
declare const logEvent: (args: LogEventOptions) => Promise;
-declare const stop: (isStopped: bool) => Promise;
+declare const stop: (isStopped: boolean) => Promise;
+declare const setConsentData: (consent: AppsFlyerConsentArgs) => Promise;
+declare const enableTCFDataCollection: (shouldCollect: boolean) => Promise;
declare const setCustomerUserId: (userId: string) => Promise;
declare const setAppInviteOneLink: (link: string) => Promise;
+declare const getAppsFlyerUID: () => string;
declare const generateInviteUrl: (args: AppsFlyerLinkGeneratorArgs) => Promise;
-export { initSdk, logEvent, stop, setCustomerUserId, setAppInviteOneLink, generateInviteUrl, };
+export { initSdk, startSdk, logEvent, stop, setCustomerUserId, setAppInviteOneLink, generateInviteUrl, getAppsFlyerUID, enableTCFDataCollection, setConsentData, };
diff --git a/appsflyer.ios.ts b/appsflyer.ios.ts
index 2b61b3d6..8b44078d 100644
--- a/appsflyer.ios.ts
+++ b/appsflyer.ios.ts
@@ -1,12 +1,7 @@
// @ts-nocheck
-import {
- Utils
-} from '@nativescript/core';
+import { Utils } from "@nativescript/core";
-import {
- InitSDKOptions,
- LogEventOptions,
-} from './index';
+import { AppsFlyerConsentArgs, InitSDKOptions, LogEventOptions } from "./index";
const nsArrayToJSArray = Utils.ios.collections.nsArrayToJSArray;
@@ -15,217 +10,288 @@ let _isDebugLocal = false;
let _conversionDataDelegate;
let _deepLinkDelegate;
-const initSdk = function (args: InitSDKOptions) {
-
- return new Promise(function (resolve, reject) {
- try {
- if (typeof(AppsFlyerLib) !== "undefined") {
-
- AppsFlyerLib.shared().appleAppID = args.appId;
- AppsFlyerLib.shared().appsFlyerDevKey = args.devKey;
- AppsFlyerLib.shared().isDebug = args.isDebug === true;
-
- if(args.timeToWaitForATTUserAuthorization){
- AppsFlyerLib.shared().waitForATTUserAuthorizationWithTimeoutInterval(args.timeToWaitForATTUserAuthorization);
- }
-
- _isDebugLocal = AppsFlyerLib.shared().isDebug;
-
- if (_isDebugLocal) {
- console.log("AF-I :: appsFlyer.initSdk: " + JSON.stringify(args));
- }
-
- if (args.onConversionDataSuccess || args.onConversionDataFail) {
- try {
- _conversionDataDelegate = ConversionDataDelegate.initWithCallbacks(
- args.onConversionDataSuccess,
- args.onConversionDataFail,
- args.onAppOpenAttribution,
- args.onAppOpenAttributionFailure,
- );
- AppsFlyerLib.shared().delegate = _conversionDataDelegate;
- } catch (e) {
- console.error(`AF-I :: delegate assignment Error: ${e}`);
- }
- }
- if(args.onDeepLinking){
- try{
- _deepLinkDelegate = DeepLinkDelegate.DeepLinkCallback(
- args.onDeepLinking
- );
- AppsFlyerLib.shared().deepLinkDelegate = _deepLinkDelegate;
- }catch (e){
- console.error(`AF-I :: onDeepLinking Error: ${e}`);
- }
- }
-
- AppsFlyerLib.shared().setPluginInfoWithPluginVersionAdditionalParams(AFSDKPlugin.AFSDKPluginNativeScript, "6.12.1", null);
-
- AppsFlyerLib.shared().start();
-
- resolve({status: "success"});
- } else {
- reject({status: "failure", message: "AppsFlyer is not defined"});
- }
- } catch (ex) {
- console.log("AF_IOS :: Error: " + ex);
- reject(ex);
- }
- });
+const startSdk = function () {
+ if (typeof AppsFlyerLib !== "undefined") {
+ console.log("AF-I :: Starting AppsFlyer SDK");
+ AppsFlyerLib.shared().start();
+ } else {
+ console.error("AF-I :: AppsFlyerLib is not defined, failed to start the SDK.");
+ }
};
+const initSdk = function (args: InitSDKOptions) {
+ return new Promise(function (resolve, reject) {
+ try {
+ if (typeof AppsFlyerLib !== "undefined") {
+ AppsFlyerLib.shared().appleAppID = args.appId;
+ AppsFlyerLib.shared().appsFlyerDevKey = args.devKey;
+ AppsFlyerLib.shared().isDebug = args.isDebug === true;
+
+ if (args.timeToWaitForATTUserAuthorization) {
+ AppsFlyerLib.shared().waitForATTUserAuthorizationWithTimeoutInterval(
+ args.timeToWaitForATTUserAuthorization
+ );
+ }
-const logEvent = function (args: LogEventOptions) {
-
- return new Promise(function (resolve, reject) {
- try {
-
- if (typeof(AppsFlyerLib) !== "undefined") {
-
- if (_isDebugLocal) {
- console.log("AF-I :: appsFlyer.logEvent: " + JSON.stringify(args));
- }
+ _isDebugLocal = AppsFlyerLib.shared().isDebug;
- AppsFlyerLib.shared().logEventWithValues(args.eventName, args.eventValues);
+ if (_isDebugLocal) {
+ console.log("AF-I :: appsFlyer.initSdk: " + JSON.stringify(args));
+ }
- resolve({status: "success"});
- } else {
- reject({status: "failure", message: "AppsFlyer is not defined, call 1st 'initSdk'"});
- }
+ if (args.onConversionDataSuccess || args.onConversionDataFail) {
+ try {
+ _conversionDataDelegate = ConversionDataDelegate.initWithCallbacks(
+ args.onConversionDataSuccess,
+ args.onConversionDataFail,
+ args.onAppOpenAttribution,
+ args.onAppOpenAttributionFailure
+ );
+ AppsFlyerLib.shared().delegate = _conversionDataDelegate;
+ } catch (e) {
+ console.error(`AF-I :: delegate assignment Error: ${e}`);
+ }
+ }
+ if (args.onDeepLinking) {
+ try {
+ _deepLinkDelegate = DeepLinkDelegate.DeepLinkCallback(
+ args.onDeepLinking
+ );
+ AppsFlyerLib.shared().deepLinkDelegate = _deepLinkDelegate;
+ } catch (e) {
+ console.error(`AF-I :: onDeepLinking Error: ${e}`);
+ }
+ }
- } catch (ex) {
- console.log("AF_IOS :: Error: " + ex);
- reject(ex);
+ AppsFlyerLib.shared().setPluginInfoWithPluginVersionAdditionalParams(
+ AFSDKPlugin.AFSDKPluginNativeScript,
+ "6.13.0",
+ null
+ );
+
+ const shouldManuallyStart = args.manualStart === true;
+ if (!shouldManuallyStart) {
+ startSdk();
}
- });
+ resolve({ status: "success" });
+ } else {
+ reject({ status: "failure", message: "AppsFlyer is not defined" });
+ }
+ } catch (ex) {
+ console.log("AF_IOS :: Error: " + ex);
+ reject(ex);
+ }
+ });
};
-const stop = function (isStopped: bool) {
-
- return new Promise(function (resolve, reject) {
- try {
-
- if (typeof(AppsFlyerLib) !== "undefined") {
+const logEvent = function (args: LogEventOptions) {
+ return new Promise(function (resolve, reject) {
+ try {
+ if (typeof AppsFlyerLib !== "undefined") {
+ if (_isDebugLocal) {
+ console.log("AF-I :: appsFlyer.logEvent: " + JSON.stringify(args));
+ }
- AppsFlyerLib.shared().isStopped = isStopped;
+ AppsFlyerLib.shared().logEventWithValues(
+ args.eventName,
+ args.eventValues
+ );
- resolve({status: "success"});
- } else {
- reject({status: "failure", message: "AppsFlyer is not defined, call 1st 'initSdk'"});
- }
+ resolve({ status: "success" });
+ } else {
+ reject({
+ status: "failure",
+ message: "AppsFlyer is not defined, call 1st 'initSdk'",
+ });
+ }
+ } catch (ex) {
+ console.log("AF_IOS :: Error: " + ex);
+ reject(ex);
+ }
+ });
+};
- } catch (ex) {
- console.log("AF_IOS :: Error: " + ex);
- reject(ex);
- }
- });
+const getAppsFlyerUID = function () {
+ if (typeof AppsFlyerLib !== "undefined") {
+ return AppsFlyerLib.shared().getAppsFlyerUID();
+ } else {
+ throw new Error("AppsFlyer is not defined, call 'initSdk' first.");
+ }
};
-const setCustomerUserId = function (userId: string) {
+const enableTCFDataCollection = function (shouldCollect: bool) {
+ return new Promise(function (resolve, reject) {
+ try {
+ if (typeof AppsFlyerLib !== "undefined") {
+ AppsFlyerLib.shared().enableTCFDataCollection(shouldCollect);
- return new Promise(function (resolve, reject) {
- try {
+ resolve({ status: "success" });
+ } else {
+ reject({
+ status: "failure",
+ message: "AppsFlyer is not defined, call 1st 'initSdk'",
+ });
+ }
+ } catch (ex) {
+ console.log("AF_IOS :: Error: " + ex);
+ reject(ex);
+ }
+ });
+};
- if (typeof(AppsFlyerLib) !== "undefined") {
+const stop = function (isStopped: bool) {
+ return new Promise(function (resolve, reject) {
+ try {
+ if (typeof AppsFlyerLib !== "undefined") {
+ AppsFlyerLib.shared().isStopped = isStopped;
- AppsFlyerLib.shared().customerUserID = userId;
+ resolve({ status: "success" });
+ } else {
+ reject({
+ status: "failure",
+ message: "AppsFlyer is not defined, call 1st 'initSdk'",
+ });
+ }
+ } catch (ex) {
+ console.log("AF_IOS :: Error: " + ex);
+ reject(ex);
+ }
+ });
+};
- resolve({status: "success"});
- } else {
- reject({status: "failure", message: "AppsFlyer is not defined, call 1st 'initSdk'"});
- }
+const setCustomerUserId = function (userId: string) {
+ return new Promise(function (resolve, reject) {
+ try {
+ if (typeof AppsFlyerLib !== "undefined") {
+ AppsFlyerLib.shared().customerUserID = userId;
- } catch (ex) {
- console.log("AF_IOS :: Error: " + ex);
- reject(ex);
- }
- });
+ resolve({ status: "success" });
+ } else {
+ reject({
+ status: "failure",
+ message: "AppsFlyer is not defined, call 1st 'initSdk'",
+ });
+ }
+ } catch (ex) {
+ console.log("AF_IOS :: Error: " + ex);
+ reject(ex);
+ }
+ });
};
const setAppInviteOneLink = function (link: string) {
+ return new Promise(function (resolve, reject) {
+ try {
+ if (typeof AppsFlyerLib !== "undefined") {
+ AppsFlyerLib.shared().appInviteOneLinkID = link;
- return new Promise(function (resolve, reject) {
- try {
-
- if (typeof(AppsFlyerLib) !== "undefined") {
-
- AppsFlyerLib.shared().appInviteOneLinkID = link;
-
- resolve({status: "success"});
- } else {
- reject({status: "failure", message: "AppsFlyer is not defined, call 1st 'initSdk'"});
- }
+ resolve({ status: "success" });
+ } else {
+ reject({
+ status: "failure",
+ message: "AppsFlyer is not defined, call 1st 'initSdk'",
+ });
+ }
+ } catch (ex) {
+ console.log("AF_IOS :: Error: " + ex);
+ reject(ex);
+ }
+ });
+};
- } catch (ex) {
- console.log("AF_IOS :: Error: " + ex);
- reject(ex);
- }
- });
+const setConsentData = function (consent) {
+ return new Promise((resolve, reject) => {
+ try {
+ if (typeof AppsFlyerLib === "undefined") {
+ throw new Error("AppsFlyerLib is not defined");
+ }
+ let consentData;
+ // Check if isUserSubjectToGDPR is explicitly true
+ if (consent.isUserSubjectToGDPR === true) {
+ // Provide default values for booleans if not defined
+ const hasConsentForDataUsage = consent.hasConsentForDataUsage === true;
+ const hasConsentForAdsPersonalization = consent.hasConsentForAdsPersonalization === true;
+ consentData = AppsFlyerConsent.alloc().initForGDPRUserWithHasConsentForDataUsageHasConsentForAdsPersonalization(
+ hasConsentForDataUsage,
+ hasConsentForAdsPersonalization
+ );
+ } else {
+ consentData = AppsFlyerConsent.alloc().initNonGDPRUser();
+ }
+ AppsFlyerLib.shared().setConsentData(consentData);
+ resolve({ status: "success" });
+ } catch (ex) {
+ reject(new Error(`Error setting consent data: ${ex.message}`));
+ }
+ });
};
const generateInviteUrl = function (args: AppsFlyerLinkGeneratorArgs) {
-
- return new Promise(function (resolve, reject) {
- try {
- const params = args.params;
- const channel: String = params.channel;
- const campaign: String = params.campaign;
- const referrerName: String = params.referrerName;
- const referrerImageUrl: String = params.referrerImageUrl;
- const customerID: String = params.customerID;
- const baseDeepLink: String = params.baseDeepLink;
- const brandDomain: String = params.brandDomain;
-
- const linkGenerator: function = function(linkGenerator: AppsFlyerLinkGenerator){
- if (channel != null && channel != "") {
- linkGenerator.setChannel(String(channel));
- }
- if (campaign != null && campaign != "") {
- linkGenerator.setCampaign(String(campaign));
- }
- if (referrerName != null && referrerName != "") {
- linkGenerator.setReferrerName(String(referrerName));
- }
- if (referrerImageUrl != null && referrerImageUrl != "") {
- linkGenerator.setReferrerImageURL(String(referrerImageUrl));
- }
- if (customerID != null && customerID != "") {
- linkGenerator.setReferrerCustomerId(String(customerID));
- }
- if (baseDeepLink != null && baseDeepLink != "") {
- linkGenerator.setBaseDeeplink(String(baseDeepLink));
- }
- if (brandDomain != null && brandDomain != "") {
- linkGenerator.brandDomain = brandDomain
- }
-
- if (!isEmpty(params.userParams)) {
- Object.entries(params.userParams).forEach(([key, value]) => {
- linkGenerator.addParameterValueForKey(String(value), key);
- })
- }
- return linkGenerator
+ return new Promise(function (resolve, reject) {
+ try {
+ const params = args.params;
+ const channel: String = params.channel;
+ const campaign: String = params.campaign;
+ const referrerName: String = params.referrerName;
+ const referrerImageUrl: String = params.referrerImageUrl;
+ const customerID: String = params.customerID;
+ const baseDeepLink: String = params.baseDeepLink;
+ const brandDomain: String = params.brandDomain;
+
+ const linkGenerator: function = function (
+ linkGenerator: AppsFlyerLinkGenerator
+ ) {
+ if (channel != null && channel != "") {
+ linkGenerator.setChannel(String(channel));
}
-
- let completionHandler = function(url: string){};
- if(args.onSuccess && args.onError){
- completionHandler = function(url: string){
- if(url !== null){
- args.onSuccess(url);
- }else{
- args.onError("failed to generate link");
- }
- }
+ if (campaign != null && campaign != "") {
+ linkGenerator.setCampaign(String(campaign));
+ }
+ if (referrerName != null && referrerName != "") {
+ linkGenerator.setReferrerName(String(referrerName));
+ }
+ if (referrerImageUrl != null && referrerImageUrl != "") {
+ linkGenerator.setReferrerImageURL(String(referrerImageUrl));
+ }
+ if (customerID != null && customerID != "") {
+ linkGenerator.setReferrerCustomerId(String(customerID));
+ }
+ if (baseDeepLink != null && baseDeepLink != "") {
+ linkGenerator.setBaseDeeplink(String(baseDeepLink));
+ }
+ if (brandDomain != null && brandDomain != "") {
+ linkGenerator.brandDomain = brandDomain;
}
-
- AppsFlyerShareInviteHelper.generateInviteUrlWithLinkGeneratorCompletionHandler(linkGenerator, completionHandler)
- } catch (ex) {
- console.log("AF_IOS :: Error: " + ex);
- reject(ex);
+ if (!isEmpty(params.userParams)) {
+ Object.entries(params.userParams).forEach(([key, value]) => {
+ linkGenerator.addParameterValueForKey(String(value), key);
+ });
+ }
+ return linkGenerator;
+ };
+
+ let completionHandler = function (url: string) {};
+ if (args.onSuccess && args.onError) {
+ completionHandler = function (url: string) {
+ if (url !== null) {
+ args.onSuccess(url);
+ } else {
+ args.onError("failed to generate link");
+ }
+ };
}
- });
+
+ AppsFlyerShareInviteHelper.generateInviteUrlWithLinkGeneratorCompletionHandler(
+ linkGenerator,
+ completionHandler
+ );
+ } catch (ex) {
+ console.log("AF_IOS :: Error: " + ex);
+ reject(ex);
+ }
+ });
};
function isEmpty(obj) {
@@ -240,151 +306,169 @@ function isEmpty(obj) {
@NativeClass
class DeepLinkDelegate extends NSObject implements AppsFlyerDeepLinkDelegate {
- public static ObjCProtocols = [AppsFlyerDeepLinkDelegate];
+ public static ObjCProtocols = [AppsFlyerDeepLinkDelegate];
- private _didResolveDeepLink: (obj: Object) => void;
+ private _didResolveDeepLink: (obj: Object) => void;
- public static DeepLinkCallback(
- didResolveDeepLink: (obj: Object) => void
- ): DeepLinkDelegate {
- const delegate: DeepLinkDelegate = DeepLinkDelegate.new() as DeepLinkDelegate;
- delegate._didResolveDeepLink = didResolveDeepLink;
- return delegate;
- }
+ public static DeepLinkCallback(
+ didResolveDeepLink: (obj: Object) => void
+ ): DeepLinkDelegate {
+ const delegate: DeepLinkDelegate =
+ DeepLinkDelegate.new() as DeepLinkDelegate;
+ delegate._didResolveDeepLink = didResolveDeepLink;
+ return delegate;
+ }
- public didResolveDeepLink(DeepLinkResult: AppsFlyerDeepLinkResult): void {
- if (!this._didResolveDeepLink) {
- return;
- }
- if (typeof this._didResolveDeepLink === 'function') {
- if (DeepLinkResult) {
- this._didResolveDeepLink(DeepLinkResult.deepLink);
- }
- } else {
- console.error(`AF-I :: _didResolveDeepLink: callback is not a function`);
+ public didResolveDeepLink(DeepLinkResult: AppsFlyerDeepLinkResult): void {
+ if (!this._didResolveDeepLink) {
+ return;
+ }
+ if (typeof this._didResolveDeepLink === "function") {
+ if (DeepLinkResult) {
+ this._didResolveDeepLink(DeepLinkResult.deepLink);
}
+ } else {
+ console.error(`AF-I :: _didResolveDeepLink: callback is not a function`);
}
-
+ }
}
@NativeClass
class ConversionDataDelegate extends NSObject implements AppsFlyerLibDelegate {
- public static ObjCProtocols = [AppsFlyerLibDelegate];
-
- private _gcdSuccessCallback: (obj: Object) => void;
- private _gcdFailureCallback: (err: string) => void;
- private _oaoaSuccessCallback: (obj: Object) => void;
- private _oaoaFailureCallback: (err: string) => void;
-
- public static initWithCallbacks(
- gcdSuccessCallback: (obj: Object) => void,
- gcdFailureCallback: (err: string) => void,
- oaoaSuccessCallback: (obj: Object) => void,
- oaoaFailureCallback: (err: string) => void
- ): ConversionDataDelegate {
- const delegate: ConversionDataDelegate = ConversionDataDelegate.new() as ConversionDataDelegate;
- delegate._gcdSuccessCallback = gcdSuccessCallback;
- delegate._gcdFailureCallback = gcdFailureCallback;
- delegate._oaoaSuccessCallback = oaoaSuccessCallback;
- delegate._oaoaFailureCallback = oaoaFailureCallback;
- return delegate;
- }
+ public static ObjCProtocols = [AppsFlyerLibDelegate];
+
+ private _gcdSuccessCallback: (obj: Object) => void;
+ private _gcdFailureCallback: (err: string) => void;
+ private _oaoaSuccessCallback: (obj: Object) => void;
+ private _oaoaFailureCallback: (err: string) => void;
+
+ public static initWithCallbacks(
+ gcdSuccessCallback: (obj: Object) => void,
+ gcdFailureCallback: (err: string) => void,
+ oaoaSuccessCallback: (obj: Object) => void,
+ oaoaFailureCallback: (err: string) => void
+ ): ConversionDataDelegate {
+ const delegate: ConversionDataDelegate =
+ ConversionDataDelegate.new() as ConversionDataDelegate;
+ delegate._gcdSuccessCallback = gcdSuccessCallback;
+ delegate._gcdFailureCallback = gcdFailureCallback;
+ delegate._oaoaSuccessCallback = oaoaSuccessCallback;
+ delegate._oaoaFailureCallback = oaoaFailureCallback;
+ return delegate;
+ }
- public onConversionDataSuccess(installData: NSDictionary): void {
- if (!this._gcdSuccessCallback) {
- return;
- }
- if (typeof this._gcdSuccessCallback === 'function') {
- const data = {};
- if (installData && installData.allKeys) {
- let keys;
- try {
- keys = nsArrayToJSArray(installData.allKeys);
- } catch (e) {
- console.error(`AF-I :: onConversionDataReceived allKeys Error: ${e}`);
- }
- if (keys && keys.length) {
- for (const key of keys) {
- try {
- data[key] = installData.objectForKey(key);
- } catch (e) {
- console.error(`AF-I :: onConversionDataReceived objectForKey Error: ${e}`);
- }
+ public onConversionDataSuccess(
+ installData: NSDictionary
+ ): void {
+ if (!this._gcdSuccessCallback) {
+ return;
+ }
+ if (typeof this._gcdSuccessCallback === "function") {
+ const data = {};
+ if (installData && installData.allKeys) {
+ let keys;
+ try {
+ keys = nsArrayToJSArray(installData.allKeys);
+ } catch (e) {
+ console.error(`AF-I :: onConversionDataReceived allKeys Error: ${e}`);
+ }
+ if (keys && keys.length) {
+ for (const key of keys) {
+ try {
+ data[key] = installData.objectForKey(key);
+ } catch (e) {
+ console.error(
+ `AF-I :: onConversionDataReceived objectForKey Error: ${e}`
+ );
}
}
}
- this._gcdSuccessCallback(data);
- } else {
- console.error(`AF-I :: onConversionDataReceived: callback is not a function`);
}
+ this._gcdSuccessCallback(data);
+ } else {
+ console.error(
+ `AF-I :: onConversionDataReceived: callback is not a function`
+ );
}
+ }
- public onConversionDataFail(error: NSError): void {
- if (!this._gcdFailureCallback) {
- return;
+ public onConversionDataFail(error: NSError): void {
+ if (!this._gcdFailureCallback) {
+ return;
+ }
+ if (typeof this._gcdFailureCallback === "function") {
+ try {
+ this._gcdFailureCallback(`${error}`);
+ } catch (e) {
+ console.error(`AF-I :: onConversionDataRequestFailure Error: ${e}`);
}
- if (typeof this._gcdFailureCallback === 'function') {
+ } else {
+ console.error(
+ `AF-I :: onConversionDataRequestFailure: callback is not a function`
+ );
+ }
+ }
+
+ onAppOpenAttribution?(attributionData: NSDictionary): void {
+ if (!this._oaoaSuccessCallback) {
+ return;
+ }
+ if (typeof this._oaoaSuccessCallback === "function") {
+ const data = {};
+ if (attributionData && attributionData.allKeys) {
+ let keys;
try {
- this._gcdFailureCallback(`${error}`);
+ keys = nsArrayToJSArray(attributionData.allKeys);
} catch (e) {
- console.error(`AF-I :: onConversionDataRequestFailure Error: ${e}`);
+ console.error(`AF-I :: onConversionDataReceived allKeys Error: ${e}`);
}
- } else {
- console.error(`AF-I :: onConversionDataRequestFailure: callback is not a function`);
- }
- }
-
- onAppOpenAttribution?(attributionData: NSDictionary): void{
- if (!this._oaoaSuccessCallback) {
- return;
- }
- if (typeof this._oaoaSuccessCallback === 'function') {
- const data = {};
- if (attributionData && attributionData.allKeys) {
- let keys;
- try {
- keys = nsArrayToJSArray(attributionData.allKeys);
- } catch (e) {
- console.error(`AF-I :: onConversionDataReceived allKeys Error: ${e}`);
- }
- if (keys && keys.length) {
- for (const key of keys) {
- try {
- data[key] = attributionData.objectForKey(key);
- } catch (e) {
- console.error(`AF-I :: onConversionDataReceived objectForKey Error: ${e}`);
- }
+ if (keys && keys.length) {
+ for (const key of keys) {
+ try {
+ data[key] = attributionData.objectForKey(key);
+ } catch (e) {
+ console.error(
+ `AF-I :: onConversionDataReceived objectForKey Error: ${e}`
+ );
}
}
}
- this._oaoaSuccessCallback(data);
- } else {
- console.error(`AF-I :: onConversionDataReceived: callback is not a function`);
}
+ this._oaoaSuccessCallback(data);
+ } else {
+ console.error(
+ `AF-I :: onConversionDataReceived: callback is not a function`
+ );
}
+ }
- onAppOpenAttributionFailure?(error: NSError): void{
- if (!this._oaoaFailureCallback) {
- return;
- }
- if (typeof this._oaoaFailureCallback === 'function') {
- try {
- this._oaoaFailureCallback(`${error}`);
- } catch (e) {
- console.error(`AF-I :: onConversionDataRequestFailure Error: ${e}`);
- }
- } else {
- console.error(`AF-I :: onConversionDataRequestFailure: callback is not a function`);
+ onAppOpenAttributionFailure?(error: NSError): void {
+ if (!this._oaoaFailureCallback) {
+ return;
+ }
+ if (typeof this._oaoaFailureCallback === "function") {
+ try {
+ this._oaoaFailureCallback(`${error}`);
+ } catch (e) {
+ console.error(`AF-I :: onConversionDataRequestFailure Error: ${e}`);
}
+ } else {
+ console.error(
+ `AF-I :: onConversionDataRequestFailure: callback is not a function`
+ );
}
-
+ }
}
export {
initSdk,
+ startSdk,
logEvent,
stop,
setCustomerUserId,
setAppInviteOneLink,
generateInviteUrl,
-}
\ No newline at end of file
+ getAppsFlyerUID,
+ enableTCFDataCollection,
+ setConsentData,
+};
diff --git a/demoNative/app/app.css b/demoNative/app/app.css
index 14de4823..abf98f9c 100644
--- a/demoNative/app/app.css
+++ b/demoNative/app/app.css
@@ -1,6 +1,76 @@
@import '@nativescript/theme/css/core.css';
@import '@nativescript/theme/css/default.css';
-Button.-primary {
+/* Page styles */
+
+.page {
+ background-color: #f9f9f9;
+}
+
+/* Container styles */
+.container {
+ padding: 8;
+ vertical-align: middle;
+ margin: 8;
+}
+
+/* ActionBar styles */
+.action-bar {
+ background-color: #3949AB;
+ color: #FFFFFF;
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
+}
+
+.action-bar-title {
+ color: #FFFFFF;
+ font-weight: 300;
+}
+
+/* Section styles */
+.section {
+ border-width: 1;
+ border-color: #ccc;
+ border-radius: 15;
+ overflow: hidden;
+ margin-bottom: 20;
+ background-color: #ffffff;
+}
+
+.section-title {
+ background-color: #5C6BC0;
+ color: #ffffff;
+ padding: 15;
+ font-size: 20;
+ border-top-left-radius: 15;
+ border-top-right-radius: 15;
+ font-weight: bold;
+ text-align: center;
+}
+
+.section-content {
+ padding: 20;
+ font-size: 16;
+ color: #555;
+}
+
+/* Button styles */
+.button {
+ background-color: #7E57C2;
+ color: #ffffff;
+ font-weight: bold;
font-size: 18;
+ border-radius: 15;
+ margin-top: 20;
+ margin-bottom: 8; /* Add space between buttons if they are stacked */
+}
+
+/* Buttons container */
+.buttons-container {
+ padding: 8;
+ width: 100%;
}
+
+/* Ensure last button does not have margin at the bottom */
+.button:last-child {
+ margin-bottom: 0;
+}
\ No newline at end of file
diff --git a/demoNative/app/main-page.xml b/demoNative/app/main-page.xml
index 4a007d8f..86fc26a0 100644
--- a/demoNative/app/main-page.xml
+++ b/demoNative/app/main-page.xml
@@ -1,35 +1,54 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
\ No newline at end of file
diff --git a/demoNative/app/main-view-model.ts b/demoNative/app/main-view-model.ts
index 3bb64da1..430582fd 100644
--- a/demoNative/app/main-view-model.ts
+++ b/demoNative/app/main-view-model.ts
@@ -1,107 +1,143 @@
-import { Observable } from "@nativescript/core";
+import { Observable, alert } from "@nativescript/core";
import * as appsFlyer from "nativescript-plugin-appsflyer";
export class HelloWorldModel extends Observable {
- options: any;
- gcdResponse: string = "GCD isn't called yet";
- logEventResponse: string = "not called yet";
- getAppsFlyerUIDResponse: string = "not called yet";
- initSdkResponse: string = "not initialized yet";
- logLocationResponse = [];
+ options: any;
+ gcdResponse: string = "GCD isn't called yet";
+ logEventResponse: string = "not called yet";
+ getAppsFlyerUIDResponse: string = "not called yet";
+ initSdkResponse: string = "not initialized yet";
+ logLocationResponse = [];
- constructor() {
- super()
- this.initSdk()
- appsFlyer.setAppInviteOneLink('abcd');
- appsFlyer.generateInviteUrl(
- {
- params: {
- channel: 'gmail',
- campaign: 'myCampaign',
- customerID: 1234,
- brandDomain: "brand.domain.com",
- userParams: {
- myParam: 'newUser',
- anotherParam: 'fromWeb',
- amount: 1,
- },
- },
- onSuccess: function(link: string){console.log(link);},
- onError: function(err: string){console.log(err);}
- }
- );
- }
+ constructor() {
+ super();
+ this.initSdk();
+ appsFlyer.enableTCFDataCollection(true);
+ appsFlyer.setConsentData({
+ isUserSubjectToGDPR: true,
+ hasConsentForAdsPersonalization: true,
+ hasConsentForDataUsage: true,
+ });
+ appsFlyer.setAppInviteOneLink("abcd");
+ appsFlyer.generateInviteUrl({
+ params: {
+ channel: "gmail",
+ campaign: "myCampaign",
+ customerID: 1234,
+ brandDomain: "brand.domain.com",
+ userParams: {
+ myParam: "newUser",
+ anotherParam: "fromWeb",
+ amount: 1,
+ },
+ },
+ onSuccess: function (link: string) {
+ console.log(link);
+ },
+ onError: function (err: string) {
+ console.log(err);
+ },
+ });
+ }
- initSdk(){
- console.log("call initSdk ... ");
- const _this = this;
+ initSdk() {
+ console.log("call initSdk ... ");
+ const _this = this;
+
+ let options = {
+ devKey: "WdpTVAcYwmxsaQ4WeTspmh",
+ appId: "975313579",
+ isDebug: true,
+ manualStart: true,
+ timeToWaitForATTUserAuthorization: 10,
+ onConversionDataSuccess: function (_res) {
+ console.log("Get conversion data success: " + JSON.stringify(_res));
+ _this.set("gcdResponse", JSON.stringify(_res));
+ },
+ onConversionDataFail: function (_res) {
+ console.log("Get conversion data failure: " + JSON.stringify(_res));
+ _this.set("gcdResponse", JSON.stringify(_res));
+ },
+ onAppOpenAttribution: function (_res) {
+ console.log("onAppOpenAttribution: " + JSON.stringify(_res));
+ _this.set("gcdResponse", "onAppOpenAttribution: " + JSON.stringify(_res));
- let options = {
- devKey: 'WdpTVAcYwmxsaQ4WeTspmh',
- appId: "975313579",
- isDebug: true,
- timeToWaitForATTUserAuthorization: 10,
- onConversionDataSuccess: function(_res){
- console.log("Get conversion data success: " + JSON.stringify(_res));
- _this.set('gcdResponse', JSON.stringify(_res))
- },
- onConversionDataFail: function(_res){
- console.log("Get conversion data failure: " + JSON.stringify(_res));
- _this.set('gcdResponse', JSON.stringify(_res))
- },
- onAppOpenAttribution: function(_res){
- console.log("onAppOpenAttribution: " + JSON.stringify(_res));
- },
- onAppOpenAttributionFailure: function(_res){
- console.log("onAppOpenAttributionFailure: " + JSON.stringify(_res));
- },
- onDeepLinking: function(_res){
- if(_res){
- console.log("onDeepLinking: " + JSON.parse(_res).deepLink);
- }
- },
- };
-
- appsFlyer.initSdk(options).then(function(result) {
- console.log("initSdk is called");
- _this.set('initSdkResponse', result.status)
-
- }, function(err) {
- console.log("initSdk error ... " + JSON.stringify(err));
- _this.set('initSdkResponse', JSON.stringify(err))
-
- });
+ },
+ onAppOpenAttributionFailure: function (_res) {
+ console.log("onAppOpenAttributionFailure: " + JSON.stringify(_res));
+ },
+ onDeepLinking: function (_res) {
+ if (_res) {
+ console.log("onDeepLinking: " + JSON.parse(_res).deepLink);
+ _this.set("gcdResponse", "onDeepLinking: " + JSON.parse(_res).deepLink);
+ }
+ },
};
-
- logEvent() {
- console.log("call logEvent ... ");
- const _this = this;
-
- let options = {
- eventName: "af_add_to_cart",
- eventValues: {
- af_content_id: "id123",
- af_currency: "USD",
- af_revenue: "2"
- },
- onSuccess: function(_res){
- console.log("onLogEventRequestSuccess results: " + JSON.stringify(_res));
- _this.set("logEventResponse", JSON.stringify(_res));
- },
- onError: function(_res){
- console.log("onLogEventRequestFailure results: " + JSON.stringify(_res));
- _this.set("logEventResponse", JSON.stringify(_res));
- },
- };
-
- appsFlyer.logEvent(options).then(function(result) {
- console.log("logEvent is called");
- _this.set("logEventResponse", JSON.stringify(result));
- }, function(err) {
- console.log("logEvent ERROR results ... " + JSON.stringify(err));
- _this.set("logEventResponse", JSON.stringify(err));
+
+ const uid = appsFlyer.getAppsFlyerUID();
+ console.log(`AF UID: ${uid}`);
+
+ appsFlyer.initSdk(options).then(
+ function (result) {
+ console.log("initSdk is called");
+ const initStatus = `Init SDK Status: ${result.status}`;
+ const manualStartStatus = options.manualStart ? "Manual start is enabled." : "Manual start is not enabled.";
+ const message = `AppsFlyer UID: ${uid}\n${manualStartStatus}`;
+
+ alert({
+ title: "Initialization Info",
+ message: message,
+ okButtonText: "OK",
});
- }
-
-}
+
+ _this.set("initSdkResponse", message);
+ },
+ function (err) {
+ console.log("initSdk error ... " + JSON.stringify(err));
+ const errorMessage = `Error initializing SDK: ${JSON.stringify(err)}`;
+ alert({
+ title: "Initialization Error",
+ message: errorMessage,
+ okButtonText: "OK",
+ });
+ _this.set("initSdkResponse", errorMessage);
+ }
+ );
+ }
+ startSdk(){
+ appsFlyer.startSdk();
+ }
+ logEvent() {
+ console.log("call logEvent ... ");
+ const _this = this;
+
+ let options = {
+ eventName: "af_add_to_cart",
+ eventValues: {
+ af_content_id: "id123",
+ af_currency: "USD",
+ af_revenue: "2",
+ },
+ onSuccess: function (_res) {
+ console.log("onLogEventRequestSuccess results: " + JSON.stringify(_res));
+ _this.set("logEventResponse", `Success response: ${JSON.stringify(_res)}\nEvent options: ${JSON.stringify(options, null, 2)}`);
+ },
+ onError: function (_res) {
+ console.log("onLogEventRequestFailure results: " + JSON.stringify(_res));
+ _this.set("logEventResponse", `Error response: ${JSON.stringify(_res)}\nEvent options: ${JSON.stringify(options, null, 2)}`);
+ },
+ };
+
+ appsFlyer.logEvent(options).then(
+ function (result) {
+ console.log("logEvent is called");
+ _this.set("logEventResponse", `Result: ${JSON.stringify(result)}\nEvent options: ${JSON.stringify(options, null, 2)}`);
+ },
+ function (err) {
+ console.log("logEvent ERROR results ... " + JSON.stringify(err));
+ _this.set("logEventResponse", `Error: ${JSON.stringify(err)}\nEvent options: ${JSON.stringify(options, null, 2)}`);
+ }
+ );
+ }
+}
diff --git a/demoNative/package.json b/demoNative/package.json
index 2ca56835..2237d7b5 100644
--- a/demoNative/package.json
+++ b/demoNative/package.json
@@ -5,12 +5,10 @@
"dependencies": {
"@nativescript/core": "~8.5.7",
"@nativescript/theme": "~3.0.2",
- "nativescript-plugin-appsflyer": "file:..",
- "tns-platform-declarations": "~6.5.15"
+ "nativescript-plugin-appsflyer": "file:.."
},
"devDependencies": {
"@nativescript/android": "~8.5.0",
- "@nativescript/ios": "8.5.2",
"@nativescript/types": "~8.5.0",
"@nativescript/webpack": "~5.0.14",
"ts-patch": "~1.3.3",
diff --git a/demoNative/tsconfig.json b/demoNative/tsconfig.json
index 2ff5d47f..f8b57112 100644
--- a/demoNative/tsconfig.json
+++ b/demoNative/tsconfig.json
@@ -1,25 +1,43 @@
{
"compilerOptions": {
"module": "esnext",
- "target": "ES2020",
+ "target": "es2017",
"moduleResolution": "node",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"noEmitHelpers": true,
"noEmitOnError": true,
"skipLibCheck": true,
- "lib": ["ESNext", "dom"],
+ "lib": [
+ "ESNext",
+ "dom",
+ "es2017"
+ ],
"baseUrl": ".",
"paths": {
- "~/*": ["app/*"],
- "@/*": ["app/*"]
+ "~/*": [
+ "app/*"
+ ],
+ "@/*": [
+ "app/*"
+ ]
},
- "plugins": [{
- "transform": "@nativescript/webpack/transformers/ns-transform-native-classes",
- "type": "raw"
- }]
+ "plugins": [
+ {
+ "transform": "@nativescript/webpack/transformers/ns-transform-native-classes",
+ "type": "raw"
+ }
+ ],
+ "removeComments": false
},
- "include": ["app/**/*"],
- "files": ["./references.d.ts"],
- "exclude": ["node_modules", "platforms"]
-}
+ "include": [
+ "app/**/*"
+ ],
+ "files": [
+ "./references.d.ts"
+ ],
+ "exclude": [
+ "node_modules",
+ "platforms"
+ ]
+}
\ No newline at end of file
diff --git a/docs/api.md b/docs/api.md
index 801161c8..cceed0cd 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -4,12 +4,15 @@
## Methods
- [initSdk](#initSdk)
+- [startSdk](#startSdk)
- [logEvent](#logEvent)
- [setSharingFilter](#setSharingFilter)
- [setSharingFilterForAllPartners](#setSharingFilterForAllPartners)
- [setCustomerUserId](#setCustomerUserId)
- [setAppInviteOneLink](#setAppInviteOneLink)
- [generateInviteUrl](#generateInviteUrl)
+- [enableTCFDataCollection](#enableTCFDataCollection)
+- [setConsentData](#setConsentData)
- [stop](#stop)
@@ -29,6 +32,7 @@ initializes the SDK.
| `devKey` |`string` | | [Appsflyer Dev key](https://support.appsflyer.com/hc/en-us/articles/207032126-AppsFlyer-SDK-Integration-Android) |
| `appId` |`string` | | [Apple Application ID](https://support.appsflyer.com/hc/en-us/articles/207032066-AppsFlyer-SDK-Integration-iOS) (for iOS only) |
| `isDebug` |`boolean`| `false` | debug mode (optional)|
+| `manualStart` |`boolean`| `false` | Prevents from the SDK from sending the launch request after using appsFlyer.initSdk(...). When using this property, the apps needs to manually trigger the appsFlyer.startSdk() API to report the app launch.|
| `onConversionDataSuccess` |`function`| | AppsFlyer allows you to access the user attribution data in real-time for every new install, directly from the SDK level. By doing this you can serve users with personalized content or send them to specific activities within the app, which can greatly enhance their engagement with your app. For [Android](https://support.appsflyer.com/hc/en-us/articles/207032126-AppsFlyer-SDK-Integration-Android#7-get-conversion-data); for [iOS](https://support.appsflyer.com/hc/en-us/articles/207032066-AppsFlyer-SDK-Integration-iOS#7-get-conversion-data) |
| `onConversionDataFailure` |`function`| | |
@@ -57,6 +61,9 @@ initializes the SDK.
---
+##### **`appsFlyer.startSdk(): void`**
+`startSDK()` In version 6.13.0 of the appslfyer-nativescript-plugin SDK we added the option of splitting between the initialization stage and start stage. All you need to do is add the property manualStart: true to the init object, and later call appsFlyer.startSdk() whenever you decide. If this property is set to false or doesn’t exist, the sdk will start after calling appsFlyer.initSdk(...).
+
##### **`appsFlyer.logEvent(options): Promise`**
@@ -214,6 +221,100 @@ appsFlyer.generateInviteUrl(
```
+---
+
+** `enableTCFDataCollection(bool shouldCollect)`**
+
+The `enableTCFDataCollection` method is employed to control the automatic collection of the Transparency and Consent Framework (TCF) data. By setting this flag to `true`, the system is instructed to automatically collect TCF data. Conversely, setting it to `false` prevents such data collection.
+
+_Example:_
+```javascript
+appsFlyer.enableTCFDataCollection(true);
+```
+---
+
+** `setConsentData(Map consentData)`**
+
+The `AppsflyerConsentArgs` interface helps manage user consent settings. By using the setConsentData we able to manually collect the TCF data.
+
+```javascript
+//For GDPR:
+appsFlyer.setConsentData({
+ isUserSubjectToGDPR: true,
+ hasConsentForAdsPersonalization: true, //optional setted to false if not defined
+ hasConsentForDataUsage: true, //optional setted to false if not defined
+ });
+
+//For Non-GDPR:
+appsFlyer.setConsentData({
+ isUserSubjectToGDPR: false,
+ });
+```
+
+The `appsFlyer` handles consent data with `setConsentData` method, where you can pass the desired `AppsflyerConsent` instance.
+
+---
+
+To reflect TCF data in the conversion (first launch) payload, it's crucial to configure `enableTCFDataCollection` **or** `setConsentData` between the SDK initialization and start phase. Follow the example provided:
+
+```javascript
+// Set AppsFlyerOption - make sure to set manualStart to true
+let options = {
+ devKey: "WdpTVAcYwmxsaQ4WeTspmh",
+ appId: "975313579",
+ isDebug: true,
+ manualStart: true,
+ timeToWaitForATTUserAuthorization: 10,
+ onConversionDataSuccess: function (_res) {
+ console.log("Get conversion data success: " + JSON.stringify(_res));
+ _this.set("gcdResponse", JSON.stringify(_res));
+ },
+ onConversionDataFail: function (_res) {
+ console.log("Get conversion data failure: " + JSON.stringify(_res));
+ _this.set("gcdResponse", JSON.stringify(_res));
+ },
+ onAppOpenAttribution: function (_res) {
+ console.log("onAppOpenAttribution: " + JSON.stringify(_res));
+ _this.set("gcdResponse", "onAppOpenAttribution: " + JSON.stringify(_res));
+
+ },
+ onAppOpenAttributionFailure: function (_res) {
+ console.log("onAppOpenAttributionFailure: " + JSON.stringify(_res));
+ },
+ onDeepLinking: function (_res) {
+ if (_res) {
+ console.log("onDeepLinking: " + JSON.parse(_res).deepLink);
+ _this.set("gcdResponse", "onDeepLinking: " + JSON.parse(_res).deepLink);
+ }
+ },
+ };
+
+appsFlyer.initSdk(options)
+
+// Set configurations to the SDK
+// Enable TCF Data Collection
+appsFlyer.enableTCFDataCollection(true);
+
+// Set Consent Data
+// If user is subject to GDPR
+ appsFlyer.setConsentData({
+ isUserSubjectToGDPR: true,
+ hasConsentForAdsPersonalization: true,
+ hasConsentForDataUsage: true,
+ });
+
+// If user is not subject to GDPR
+// appsFlyer.setConsentData({
+// isUserSubjectToGDPR: false,
+// });
+
+// Here we start a session
+appsFlyer.startSDK();
+```
+
+Following this sequence ensures that the consent configurations take effect before the AppsFlyer SDK starts, providing accurate consent data in the first launch payload.
+Note: You need to use either `enableTCFDataCollection` or `setConsentData` if you use both of them our backend will prioritize the provided consent data from `setConsentData`.
+
---
##### **`appsFlyer.stop(isStopped): void`**
diff --git a/index.d.ts b/index.d.ts
index d2af5cb4..f2bb13e7 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -3,6 +3,7 @@ export interface InitSDKOptions {
appId?: string;
isDebug?: boolean;
timeToWaitForATTUserAuthorization?: NSTimeInterval;
+ manualStart?: boolean; //If true need to call startSdk , otherwise the SDK will start when initSdk is invoked.
onConversionDataSuccess?: (obj: ConversionData) => void;
onConversionDataFail?: (err: string) => void;
onAppOpenAttribution?: (obj: Object) => void;
@@ -23,8 +24,17 @@ export interface AppsFlyerLinkGeneratorArgs {
onError?: (err: string) => void;
}
+//Interface for AppsFlyerConsent parameters
+export interface AppsFlyerConsentArgs{
+ isUserSubjectToGDPR: boolean
+ hasConsentForDataUsage?: boolean
+ hasConsentForAdsPersonalization?: boolean
+}
+
export function initSdk(options: InitSDKOptions): Promise<{status} | any>;
+export function startSdk(): void;
+
export function logEvent(options: LogEventOptions): Promise<{status} | any>;
export function setSharingFilter(partners: Array): Promise<{status} | any>;
@@ -35,6 +45,12 @@ export function setCustomerUserId (userId: string): Promise<{status} | any>;
export function setAppInviteOneLink (link: string): void;
+export function enableTCFDataCollection(shouldCollect: boolean): void;
+
+export function getAppsFlyerUID(): string;
+
+export function setConsentData(consent: AppsFlyerConsentArgs) : void;
+
export function stop (isStopped: bool): void;
export function generateInviteUrl (args: AppsFlyerLinkGeneratorArgs): void;
diff --git a/package.json b/package.json
index ea10a7ca..862e622e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "nativescript-plugin-appsflyer",
- "version": "6.12.7",
+ "version": "6.13.0",
"description": "Appsflyer SDK for NativeScript applications",
"main": "appsflyer",
"typings": "index.d.ts",
diff --git a/platforms/android/include.gradle b/platforms/android/include.gradle
index 4acf8532..bb5e2877 100644
--- a/platforms/android/include.gradle
+++ b/platforms/android/include.gradle
@@ -14,5 +14,5 @@ def safeExtGet(prop, fallback) {
}
dependencies {
implementation "com.android.installreferrer:installreferrer:${safeExtGet('installreferrer', '2.2')}"
- implementation "com.appsflyer:af-android-sdk:${safeExtGet('appsflyerVersion', "6.12.1")}"
+ implementation "com.appsflyer:af-android-sdk:${safeExtGet('appsflyerVersion', "6.13.0")}"
}
diff --git a/platforms/ios/Podfile b/platforms/ios/Podfile
index 3d7def81..ddd77595 100644
--- a/platforms/ios/Podfile
+++ b/platforms/ios/Podfile
@@ -1 +1 @@
-pod 'AppsFlyerFramework', '~> 6.12.0'
\ No newline at end of file
+pod 'AppsFlyerFramework', '~> 6.13.0'
\ No newline at end of file
diff --git a/typings/java!AppsFlyer.d.ts b/typings/java!AppsFlyer.d.ts
index 4054456c..bbf0845a 100644
--- a/typings/java!AppsFlyer.d.ts
+++ b/typings/java!AppsFlyer.d.ts
@@ -247,6 +247,21 @@ declare module com {
}
}
+declare module com {
+ export module appsflyer {
+ export class AppsFlyerConsent {
+
+ public isUserSubjectToGDPR: boolean;
+ public hasConsentForDataUsage: boolean | null;
+ public hasConsentForAdsPersonalization: boolean | null;
+
+ public static forGDPRUser(hasConsentForDataUsage: boolean, hasConsentForAdsPersonalization: boolean): com.appsflyer.AppsFlyerConsent;
+
+ public static forNonGDPRUser(): com.appsflyer.AppsFlyerConsent;
+ }
+ }
+}
+
import javautilHashMap = java.util.HashMap;
import androidappActivity = android.app.Activity;
import androidappApplication = android.app.Application;
@@ -276,6 +291,8 @@ declare module com {
public static PRE_INSTALL_SYSTEM_DEFAULT: string;
public static PRE_INSTALL_SYSTEM_DEFAULT_ETC: string;
public static AF_PRE_INSTALL_PATH: string;
+ public setConsentData(consent: AppsFlyerConsent): void;
+ public enableTCFDataCollection(shouldCollect: bool): void;
public stop(isStopped: bool, context: androidcontentContext): void;
public setPluginInfo(pluginInfo: PluginInfo): void;
public subscribeForDeepLink(deepLinkListener: DeepLinkListener): void;
diff --git a/typings/objc!AppsFlyerLib.d.ts b/typings/objc!AppsFlyerLib.d.ts
index 07e5c89b..03e4980f 100644
--- a/typings/objc!AppsFlyerLib.d.ts
+++ b/typings/objc!AppsFlyerLib.d.ts
@@ -1,219 +1,269 @@
-
declare class AppsFlyerCrossPromotionHelper extends NSObject {
+ static alloc(): AppsFlyerCrossPromotionHelper; // inherited from NSObject
- static alloc(): AppsFlyerCrossPromotionHelper; // inherited from NSObject
-
- static new(): AppsFlyerCrossPromotionHelper; // inherited from NSObject
+ static new(): AppsFlyerCrossPromotionHelper; // inherited from NSObject
- static logCrossPromotionAndOpenStore(appID: string, campaign: string, parameters: NSDictionary, openStoreBlock: (p1: NSURLSession, p2: NSURL) => void): void;
+ static logCrossPromotionAndOpenStore(
+ appID: string,
+ campaign: string,
+ parameters: NSDictionary,
+ openStoreBlock: (p1: NSURLSession, p2: NSURL) => void
+ ): void;
- static logCrossPromotionImpression(appID: string, campaign: string): void;
+ static logCrossPromotionImpression(appID: string, campaign: string): void;
}
declare class AppsFlyerLinkGenerator extends NSObject {
+ static alloc(): AppsFlyerLinkGenerator; // inherited from NSObject
- static alloc(): AppsFlyerLinkGenerator; // inherited from NSObject
+ static new(): AppsFlyerLinkGenerator; // inherited from NSObject
- static new(): AppsFlyerLinkGenerator; // inherited from NSObject
+ addParameterValueForKey(value: string, key: string): void;
- addParameterValueForKey(value: string, key: string): void;
+ addParameters(parameters: NSDictionary): void;
- addParameters(parameters: NSDictionary): void;
+ setAppleAppID(appleAppID: string): void;
- setAppleAppID(appleAppID: string): void;
+ setBaseDeeplink(baseDeeplink: string): void;
- setBaseDeeplink(baseDeeplink: string): void;
+ setCampaign(campaign: string): void;
- setCampaign(campaign: string): void;
+ setChannel(channel: string): void;
- setChannel(channel: string): void;
+ setDeeplinkPath(deeplinkPath: string): void;
- setDeeplinkPath(deeplinkPath: string): void;
+ setReferrerCustomerId(referrerCustomerId: string): void;
- setReferrerCustomerId(referrerCustomerId: string): void;
+ setReferrerImageURL(referrerImageURL: string): void;
- setReferrerImageURL(referrerImageURL: string): void;
+ setReferrerName(referrerName: string): void;
- setReferrerName(referrerName: string): void;
+ setReferrerUID(referrerUID: string): void;
- setReferrerUID(referrerUID: string): void;
-
- setBrandDomain(brandDomain: string): void;
+ setBrandDomain(brandDomain: string): void;
}
declare class AppsFlyerShareInviteHelper extends NSObject {
+ static alloc(): AppsFlyerShareInviteHelper; // inherited from NSObject
+
+ static generateInviteUrlWithLinkGeneratorCompletionHandler(
+ generatorCreator: (p1: AppsFlyerLinkGenerator) => AppsFlyerLinkGenerator,
+ completionHandler: (p1: NSURL) => void
+ ): void;
- static alloc(): AppsFlyerShareInviteHelper; // inherited from NSObject
+ static new(): AppsFlyerShareInviteHelper; // inherited from NSObject
- static generateInviteUrlWithLinkGeneratorCompletionHandler(generatorCreator: (p1: AppsFlyerLinkGenerator) => AppsFlyerLinkGenerator, completionHandler: (p1: NSURL) => void): void;
+ static logInvite(channel: string, parameters: NSDictionary): void;
+}
+
+//AppsFlyerConsent bridging class
+declare class AppsFlyerConsent extends NSObject {
+ static alloc(): AppsFlyerConsent; // required for instantiation
- static new(): AppsFlyerShareInviteHelper; // inherited from NSObject
+ static new(): AppsFlyerConsent; // override "new" as unavailable
- static logInvite(channel: string, parameters: NSDictionary): void;
+ isUserSubjectToGDPR: boolean;
+ hasConsentForDataUsage: boolean;
+ hasConsentForAdsPersonalization: boolean;
+
+ static initForGDPRUserWithHasConsentForDataUsageHasConsentForAdsPersonalization(
+ hasConsentForDataUsage: boolean,
+ hasConsentForAdsPersonalization: boolean
+ ): AppsFlyerConsent;
+ static initNonGDPRUser(): AppsFlyerConsent;
}
declare class AppsFlyerLib extends NSObject {
+ static alloc(): AppsFlyerLib; // inherited from NSObject
+
+ static new(): AppsFlyerLib; // inherited from NSObject
- static alloc(): AppsFlyerLib; // inherited from NSObject
+ static shared(): AppsFlyerLib;
- static new(): AppsFlyerLib; // inherited from NSObject
+ advertiserId: string;
- static shared(): AppsFlyerLib;
+ appInviteOneLinkID: string;
- advertiserId: string;
+ appleAppID: string;
- appInviteOneLinkID: string;
+ appsFlyerDevKey: string;
- appleAppID: string;
+ currencyCode: string;
- appsFlyerDevKey: string;
+ customData: NSDictionary;
- currencyCode: string;
+ customerUserID: string;
- customData: NSDictionary;
+ delegate: AppsFlyerLibDelegate;
- customerUserID: string;
+ deepLinkDelegate: AppsFlyerDeepLinkDelegate;
- delegate: AppsFlyerLibDelegate;
+ anonymizeUser: boolean;
- deepLinkDelegate: AppsFlyerDeepLinkDelegate;
+ disableCollectASA: boolean;
- anonymizeUser: boolean;
+ host: string;
- disableCollectASA: boolean;
+ isDebug: boolean;
- host: string;
+ shouldCollect: boolean;
- isDebug: boolean;
+ isStopped: boolean;
- isStopped: boolean;
+ minTimeBetweenSessions: number;
- minTimeBetweenSessions: number;
+ shouldCollectDeviceName: boolean;
- shouldCollectDeviceName: boolean;
+ useReceiptValidationSandbox: boolean;
- useReceiptValidationSandbox: boolean;
+ useUninstallSandbox: boolean;
- useUninstallSandbox: boolean;
+ setConsentData(consent: AppsFlyerConsent): void;
- setPluginInfoWithPluginVersionAdditionalParams(initWithPlugin: AFSDKPlugin, pluginVersion: string, additionalParams: NSDictionary): void;
-
- continueUserActivityRestorationHandler(userActivity: NSUserActivity, restorationHandler: (p1: NSArray) => void): boolean;
+ enableTCFDataCollection(shouldCollect: boolean): void;
- didUpdateUserActivity(userActivity: NSUserActivity): void;
+ setPluginInfoWithPluginVersionAdditionalParams(
+ initWithPlugin: AFSDKPlugin,
+ pluginVersion: string,
+ additionalParams: NSDictionary
+ ): void;
- getAppsFlyerUID(): string;
+ continueUserActivityRestorationHandler(
+ userActivity: NSUserActivity,
+ restorationHandler: (p1: NSArray) => void
+ ): boolean;
- getSDKVersion(): string;
+ didUpdateUserActivity(userActivity: NSUserActivity): void;
- handleOpenURLSourceApplication(url: NSURL, sourceApplication: string): void;
+ getAppsFlyerUID(): string;
- handleOpenURLSourceApplicationWithAnnotation(url: NSURL, sourceApplication: string, annotation: any): void;
+ getSDKVersion(): string;
- handleOpenUrlOptions(url: NSURL, options: NSDictionary): void;
+ handleOpenURLSourceApplication(url: NSURL, sourceApplication: string): void;
- handlePushNotification(pushPayload: NSDictionary): void;
+ handleOpenURLSourceApplicationWithAnnotation(
+ url: NSURL,
+ sourceApplication: string,
+ annotation: any
+ ): void;
- loadConversionDataWithDelegate(delegate: AppsFlyerLibDelegate): void;
+ handleOpenUrlOptions(url: NSURL, options: NSDictionary): void;
- registerUninstall(deviceToken: NSData): void;
+ handlePushNotification(pushPayload: NSDictionary): void;
- remoteDebuggingCallWithData(data: string): void;
+ loadConversionDataWithDelegate(delegate: AppsFlyerLibDelegate): void;
- setUserEmailsWithCryptType(userEmails: NSArray, type: EmailCryptType): void;
+ registerUninstall(deviceToken: NSData): void;
- start(): void;
+ remoteDebuggingCallWithData(data: string): void;
- logEventWithValues(eventName: string, values: NSDictionary): void;
-
- logEventWithEventNameEventValuesCompletionHandler(eventName: string, values: NSDictionary, completionHandler: (p1: NSDictionary, p2: NSError) => void): void;
+ setUserEmailsWithCryptType(
+ userEmails: NSArray,
+ type: EmailCryptType
+ ): void;
- logLocationLatitude(longitude: number, latitude: number): void;
+ start(): void;
- validateAndLogInAppPurchase(productIdentifier: string, price: string, currency: string, tranactionId: string, params: NSDictionary, successBlock: (p1: NSDictionary) => void, failedBlock: (p1: NSError, p2: any) => void): void;
+ logEventWithValues(eventName: string, values: NSDictionary): void;
- waitForATTUserAuthorizationWithTimeoutInterval(timeoutInterval: NSTimeInterval): void;
+ logEventWithEventNameEventValuesCompletionHandler(
+ eventName: string,
+ values: NSDictionary,
+ completionHandler: (p1: NSDictionary, p2: NSError) => void
+ ): void;
+
+ logLocationLatitude(longitude: number, latitude: number): void;
+
+ validateAndLogInAppPurchase(
+ productIdentifier: string,
+ price: string,
+ currency: string,
+ tranactionId: string,
+ params: NSDictionary,
+ successBlock: (p1: NSDictionary) => void,
+ failedBlock: (p1: NSError, p2: any) => void
+ ): void;
+
+ waitForATTUserAuthorizationWithTimeoutInterval(
+ timeoutInterval: NSTimeInterval
+ ): void;
}
declare class AppsFlyerDeepLinkResult extends NSObject {
- static alloc(): AppsFlyerDeepLinkResult; // inherited from NSObject
- static new(): AppsFlyerDeepLinkResult;
-
- deepLink: AppsFlyerDeepLink;
- status: AFSDKDeepLinkResultStatus;
- error: NSError;
+ static alloc(): AppsFlyerDeepLinkResult; // inherited from NSObject
+ static new(): AppsFlyerDeepLinkResult;
+
+ deepLink: AppsFlyerDeepLink;
+ status: AFSDKDeepLinkResultStatus;
+ error: NSError;
}
declare class AppsFlyerDeepLink extends NSObject {
- static alloc(): AppsFlyerDeepLink; // inherited from NSObject
- static new(): AppsFlyerDeepLink;
-
- clickEvent: NSDictionary;
- deeplinkValue: string;
- matchType: string;
- clickHTTPReferrer: string;
- mediaSource: string;
- campaign: string;
- campaignId: string;
- afSub1: string;
- afSub2: string;
- afSub3: string;
- afSub4: string;
- afSub5: string;
- isDeferred: boolean;
- toString(): string;
+ static alloc(): AppsFlyerDeepLink; // inherited from NSObject
+ static new(): AppsFlyerDeepLink;
+
+ clickEvent: NSDictionary;
+ deeplinkValue: string;
+ matchType: string;
+ clickHTTPReferrer: string;
+ mediaSource: string;
+ campaign: string;
+ campaignId: string;
+ afSub1: string;
+ afSub2: string;
+ afSub3: string;
+ afSub4: string;
+ afSub5: string;
+ isDeferred: boolean;
+ toString(): string;
}
interface AppsFlyerDeepLinkDelegate extends NSObjectProtocol {
- didResolveDeepLink?(result: AppsFlyerDeepLinkResult): void;
+ didResolveDeepLink?(result: AppsFlyerDeepLinkResult): void;
}
declare var AppsFlyerDeepLinkDelegate: {
- prototype: AppsFlyerDeepLinkDelegate;
+ prototype: AppsFlyerDeepLinkDelegate;
};
interface AppsFlyerLibDelegate extends NSObjectProtocol {
+ onAppOpenAttribution?(attributionData: NSDictionary): void;
- onAppOpenAttribution?(attributionData: NSDictionary): void;
+ onAppOpenAttributionFailure?(error: NSError): void;
- onAppOpenAttributionFailure?(error: NSError): void;
+ onConversionDataSuccess?(installData: NSDictionary): void;
- onConversionDataSuccess?(installData: NSDictionary): void;
-
- onConversionDataFail?(error: NSError): void;
+ onConversionDataFail?(error: NSError): void;
}
declare var AppsFlyerLibDelegate: {
- prototype: AppsFlyerLibDelegate;
+ prototype: AppsFlyerLibDelegate;
};
declare const enum EmailCryptType {
+ None = 0,
- None = 0,
-
- SHA1 = 1,
+ SHA1 = 1,
- MD5 = 2,
+ MD5 = 2,
- SHA256 = 3
+ SHA256 = 3,
}
declare const enum AFSDKPlugin {
-
- AFSDKPluginIOSNative = 0,
- AFSDKPluginUnity = 1,
- AFSDKPluginFlutter = 2,
- AFSDKPluginReactNative = 3,
- AFSDKPluginAdobeAir = 4,
- AFSDKPluginAdobeMobile = 5,
- AFSDKPluginCocos2dx = 6,
- AFSDKPluginCordova = 7,
- AFSDKPluginMparticle = 8,
- AFSDKPluginNativeScript = 9,
- AFSDKPluginExpo = 10,
- AFSDKPluginUnreal = 11,
- AFSDKPluginXamarin = 12,
- AFSDKPluginCapacitor = 13,
- AFSDKPluginSegment = 14,
- AFSDKPluginAdobeSwiftAEP = 15
-
+ AFSDKPluginIOSNative = 0,
+ AFSDKPluginUnity = 1,
+ AFSDKPluginFlutter = 2,
+ AFSDKPluginReactNative = 3,
+ AFSDKPluginAdobeAir = 4,
+ AFSDKPluginAdobeMobile = 5,
+ AFSDKPluginCocos2dx = 6,
+ AFSDKPluginCordova = 7,
+ AFSDKPluginMparticle = 8,
+ AFSDKPluginNativeScript = 9,
+ AFSDKPluginExpo = 10,
+ AFSDKPluginUnreal = 11,
+ AFSDKPluginXamarin = 12,
+ AFSDKPluginCapacitor = 13,
+ AFSDKPluginSegment = 14,
+ AFSDKPluginAdobeSwiftAEP = 15,
}