appsflyer-capacitor-plugin 6.17.0 → 6.17.5-RC1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,15 +7,14 @@
7
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
8
8
  [![Downloads](https://img.shields.io/npm/dm/appsflyer-capacitor-plugin)](https://www.npmjs.com/package/appsflyer-capacitor-plugin)
9
9
 
10
- 🛠 In order for us to provide optimal support, we would kindly ask you to submit any issues to support@appsflyer.com
11
-
12
- > *When submitting an issue please specify your AppsFlyer sign-up (account) email , your app ID , production steps, logs, code snippets and any additional relevant information.*
10
+ 🛠 In order for us to provide optimal support, please contact AppsFlyer support through the Customer Assistant Chatbot for assistance with troubleshooting issues or product guidance. </br>
11
+ To do so, please follow [this article](https://support.appsflyer.com/hc/en-us/articles/23583984402193-Using-the-Customer-Assistant-Chatbot).
13
12
 
14
13
 
15
14
  ### <a id="plugin-build-for"> This plugin is built for:
16
15
 
17
- <img src="https://raw.githubusercontent.com/github/explore/80688e429a7d4ef2fca1e82350fe8e3517d3494d/topics/android/android.png" width="18" height="18"> Android AppsFlyer SDK **6.17.0**</br>
18
- <img src="https://icon.icepanel.io/Technology/svg/Apple.svg" width="18" height="18"> iOS AppsFlyer SDK **6.17.0**</br>
16
+ <img src="https://raw.githubusercontent.com/github/explore/80688e429a7d4ef2fca1e82350fe8e3517d3494d/topics/android/android.png" width="18" height="18"> Android AppsFlyer SDK **6.17.3**</br>
17
+ <img src="https://icon.icepanel.io/Technology/svg/Apple.svg" width="18" height="18"> iOS AppsFlyer SDK **6.17.5**</br>
19
18
  <img src="https://icon.icepanel.io/Technology/svg/Capacitor.svg" width="18" height="18"> Capacitor 7</br>
20
19
 
21
20
  ## <a id="breaking-changes-6-17-0"> ❗❗ Breaking changes when updating to v6.17.0 ❗❗
@@ -69,4 +69,8 @@ const val AF_MONETIZATION_NETWORK = "monetizationNetwork"
69
69
  const val AF_CURRENCY_ISO4217_CODE = "currencyIso4217Code"
70
70
  const val AF_REVENUE = "revenue"
71
71
  const val AF_MEDIATION_NETWORK = "mediationNetwork"
72
+ const val AF_PURCHASE_DETAILS = "purchaseDetails"
73
+ const val AF_PURCHASE_TYPE = "purchaseType"
74
+ const val AF_PURCHASE_TOKEN = "purchaseToken"
75
+ const val AF_PRODUCT_ID = "productId"
72
76
 
@@ -339,7 +339,7 @@ class AppsFlyerPlugin : Plugin() {
339
339
  @PluginMethod
340
340
  fun isSDKStopped(call: PluginCall) {
341
341
  val result = JSObject().apply {
342
- put("isSDKStopped", AppsFlyerLib.getInstance().isStopped)
342
+ put("isStopped", AppsFlyerLib.getInstance().isStopped)
343
343
  }
344
344
  call.resolve(result)
345
345
  }
@@ -437,10 +437,89 @@ class AppsFlyerPlugin : Plugin() {
437
437
  } else {
438
438
  call.reject("Missing some fields")
439
439
  }
440
+ }
441
+
442
+ @PluginMethod
443
+ fun validateAndLogInAppPurchaseIos(call: PluginCall) {
444
+ call.unavailable()
445
+ }
446
+
447
+ @PluginMethod
448
+ fun validateAndLogInAppPurchaseV2(call: PluginCall) {
449
+ try {
450
+ val purchaseDetailsMap = call.getObject(AF_PURCHASE_DETAILS)
451
+ ?: return call.reject("Purchase details are required")
452
+ val additionalParameters = call.getObject(AF_ADDITIONAL_PARAMETERS)
453
+
454
+ // Extract purchase details
455
+ val purchaseTypeString = purchaseDetailsMap.getString(AF_PURCHASE_TYPE)
456
+ ?: return call.reject("Purchase type is required")
457
+ val purchaseToken = purchaseDetailsMap.getString(AF_PURCHASE_TOKEN)
458
+ ?: return call.reject("Purchase token is required")
459
+ val productId = purchaseDetailsMap.getString(AF_PRODUCT_ID)
460
+ ?: return call.reject("Product ID is required")
461
+
462
+ // Map purchase type
463
+ val purchaseType = mapPurchaseType(purchaseTypeString)
464
+ ?: return call.reject("Invalid purchase type: $purchaseTypeString")
465
+
466
+ // Create AFPurchaseDetails object
467
+ val purchaseDetails = AFPurchaseDetails(
468
+ purchaseType,
469
+ purchaseToken,
470
+ productId
471
+ )
472
+
473
+ // Convert additional parameters
474
+ val additionalParamsMap = additionalParameters?.let {
475
+ AFHelpers.jsonToStringMap(it)
476
+ }
477
+
478
+ // Call AppsFlyer SDK
479
+ AppsFlyerLib.getInstance().validateAndLogInAppPurchase(
480
+ purchaseDetails,
481
+ additionalParamsMap,
482
+ object : AppsFlyerInAppPurchaseValidationCallback {
483
+ override fun onInAppPurchaseValidationFinished(validationResult: Map<String, Any?>) {
484
+ try {
485
+ val jsonResult = JSObject()
486
+ for ((key, value) in validationResult) {
487
+ jsonResult.put(key, value)
488
+ }
489
+ call.resolve(jsonResult)
490
+ } catch (e: Exception) {
491
+ call.reject("Error parsing validation result: ${e.message}")
492
+ }
493
+ }
494
+
495
+ override fun onInAppPurchaseValidationError(validationError: Map<String, Any>) {
496
+ try {
497
+ var errorMessage = "Validation failed"
498
+ if (validationError.containsKey("error")) {
499
+ errorMessage = validationError["error"].toString()
500
+ }
501
+
502
+ val jsonError = JSObject()
503
+ for ((key, value) in validationError) {
504
+ jsonError.put(key, value)
505
+ }
506
+ call.reject(errorMessage, jsonError.toString())
507
+ } catch (e: Exception) {
508
+ call.reject("Error parsing validation error: ${e.message}")
509
+ }
510
+ }
511
+ }
512
+ )
513
+ } catch (e: Exception) {
514
+ call.reject("Error in validateAndLogInAppPurchaseV2: ${e.message}")
515
+ }
516
+ }
440
517
 
441
- @PluginMethod
442
- fun validateAndLogInAppPurchaseIos(call: PluginCall) {
443
- call.unavailable()
518
+ private fun mapPurchaseType(purchaseTypeString: String): AFPurchaseType? {
519
+ return when (purchaseTypeString) {
520
+ "subscription" -> AFPurchaseType.SUBSCRIPTION
521
+ "one_time_purchase" -> AFPurchaseType.ONE_TIME_PURCHASE
522
+ else -> null
444
523
  }
445
524
  }
446
525
 
@@ -7,6 +7,10 @@ export declare enum AFConstants {
7
7
  OAOA_CALLBACK = "oaoa_callback",
8
8
  UDL_CALLBACK = "udl_callback"
9
9
  }
10
+ export declare enum AFPurchaseType {
11
+ oneTimePurchase = "one_time_purchase",
12
+ subscription = "subscription"
13
+ }
10
14
  export declare enum MediationNetwork {
11
15
  IRONSOURCE = "ironsource",
12
16
  APPLOVIN_MAX = "applovin_max",
@@ -8,6 +8,11 @@ export var AFConstants;
8
8
  AFConstants["OAOA_CALLBACK"] = "oaoa_callback";
9
9
  AFConstants["UDL_CALLBACK"] = "udl_callback";
10
10
  })(AFConstants || (AFConstants = {}));
11
+ export var AFPurchaseType;
12
+ (function (AFPurchaseType) {
13
+ AFPurchaseType["oneTimePurchase"] = "one_time_purchase";
14
+ AFPurchaseType["subscription"] = "subscription";
15
+ })(AFPurchaseType || (AFPurchaseType = {}));
11
16
  export var MediationNetwork;
12
17
  (function (MediationNetwork) {
13
18
  MediationNetwork["IRONSOURCE"] = "ironsource";
@@ -1 +1 @@
1
- {"version":3,"file":"Appsflyer_constants.js","sourceRoot":"","sources":["../../src/Appsflyer_constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,WAQX;AARD,WAAY,WAAW;IACnB,kEAAmD,CAAA;IACnD,4DAA6C,CAAA;IAC7C,4DAA6C,CAAA;IAC7C,4DAA6C,CAAA;IAC7C,0DAA2C,CAAA;IAC3C,8CAA+B,CAAA;IAC/B,4CAA6B,CAAA;AACjC,CAAC,EARW,WAAW,KAAX,WAAW,QAQtB;AAGD,MAAM,CAAN,IAAY,gBAeX;AAfD,WAAY,gBAAgB;IACxB,6CAAyB,CAAA;IACzB,iDAA6B,CAAA;IAC7B,iDAA6B,CAAA;IAC7B,mCAAe,CAAA;IACf,yCAAqB,CAAA;IACrB,qCAAiB,CAAA;IACjB,mCAAe,CAAA;IACf,yCAAqB,CAAA;IACrB,qCAAiB,CAAA;IACjB,6CAAyB,CAAA;IACzB,mCAAe,CAAA;IACf,2CAAuB,CAAA;IACvB,yDAAqC,CAAA;IACrC,+EAA2D,CAAA;AAC/D,CAAC,EAfW,gBAAgB,KAAhB,gBAAgB,QAe3B"}
1
+ {"version":3,"file":"Appsflyer_constants.js","sourceRoot":"","sources":["../../src/Appsflyer_constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,WAQX;AARD,WAAY,WAAW;IACnB,kEAAmD,CAAA;IACnD,4DAA6C,CAAA;IAC7C,4DAA6C,CAAA;IAC7C,4DAA6C,CAAA;IAC7C,0DAA2C,CAAA;IAC3C,8CAA+B,CAAA;IAC/B,4CAA6B,CAAA;AACjC,CAAC,EARW,WAAW,KAAX,WAAW,QAQtB;AAGD,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,uDAAqC,CAAA;IACrC,+CAA6B,CAAA;AACjC,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,MAAM,CAAN,IAAY,gBAeX;AAfD,WAAY,gBAAgB;IACxB,6CAAyB,CAAA;IACzB,iDAA6B,CAAA;IAC7B,iDAA6B,CAAA;IAC7B,mCAAe,CAAA;IACf,yCAAqB,CAAA;IACrB,qCAAiB,CAAA;IACjB,mCAAe,CAAA;IACf,yCAAqB,CAAA;IACrB,qCAAiB,CAAA;IACjB,6CAAyB,CAAA;IACzB,mCAAe,CAAA;IACf,2CAAuB,CAAA;IACvB,yDAAqC,CAAA;IACrC,+EAA2D,CAAA;AAC/D,CAAC,EAfW,gBAAgB,KAAhB,gBAAgB,QAe3B"}
@@ -1,4 +1,4 @@
1
- import type { MediationNetwork } from "./Appsflyer_constants";
1
+ import type { MediationNetwork, AFPurchaseType } from "./Appsflyer_constants";
2
2
  export interface AFInit {
3
3
  devKey: string;
4
4
  appID: string;
@@ -185,4 +185,16 @@ export interface AFConsentOptions {
185
185
  hasConsentForAdsPersonalization?: boolean | null;
186
186
  hasConsentForAdStorage?: boolean | null;
187
187
  }
188
+ export interface AFIsStarted {
189
+ isStarted: boolean;
190
+ }
191
+ export interface AFPurchaseDetails {
192
+ purchaseType: AFPurchaseType;
193
+ purchaseToken: string;
194
+ productId: string;
195
+ }
196
+ export interface AFPurchaseDetailsV2 {
197
+ purchaseDetails: AFPurchaseDetails;
198
+ additionalParameters?: StringMap;
199
+ }
188
200
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { PluginListenerHandle } from "@capacitor/core";
2
2
  import type { AFConstants } from "./Appsflyer_constants";
3
- import type { AFAndroidInAppPurchase, AFAnonymizeUser, AFAppendToDeepLink, AFCuid, AFCurrency, AFData, AFDisable, AFEvent, AFFbDAL, AFFilters, AFHost, AFInit, AFIosInAppPurchase, AFIsStopped, AFLink, AFLinkGenerator, AFOnelinkDomain, AFOnelinkID, AFPath, AFPushPayload, AFRes, AFStop, AFUid, AFUninstall, AFUrls, AFLanguage, OnAppOpenAttribution, OnConversionDataResult, OnDeepLink, AFPromotion, AFEmails, AFLatLng, AFPhone, AFPartnerData, AFLogInvite, AFEnableTCFDataCollection, AFConsentData, AFAdRevenueData, AFConsentOptions } from "./appsflyer_interfaces";
3
+ import type { AFAndroidInAppPurchase, AFAnonymizeUser, AFAppendToDeepLink, AFCuid, AFCurrency, AFData, AFDisable, AFEvent, AFFbDAL, AFFilters, AFHost, AFInit, AFIosInAppPurchase, AFIsStopped, AFLink, AFLinkGenerator, AFOnelinkDomain, AFOnelinkID, AFPath, AFPushPayload, AFRes, AFStop, AFUid, AFUninstall, AFUrls, AFLanguage, OnAppOpenAttribution, OnConversionDataResult, OnDeepLink, AFPromotion, AFEmails, AFLatLng, AFPhone, AFPartnerData, AFLogInvite, AFEnableTCFDataCollection, AFConsentData, AFAdRevenueData, AFConsentOptions, AFIsStarted } from "./appsflyer_interfaces";
4
4
  export interface AppsFlyerPlugin {
5
5
  addListener(eventName: AFConstants.CONVERSION_CALLBACK, listenerFunc: (event: OnConversionDataResult) => void): PluginListenerHandle;
6
6
  addListener(eventName: AFConstants.OAOA_CALLBACK, listenerFunc: (event: OnAppOpenAttribution) => void): PluginListenerHandle;
@@ -188,6 +188,14 @@ export interface AppsFlyerPlugin {
188
188
  * @param options: AFConsentOptions that consists with all the possible options for consent collection, boolean params.
189
189
  */
190
190
  setConsentDataV2(options: AFConsentOptions): Promise<void>;
191
+ /**
192
+ * Use this method to check whether the AppsFlyer SDK has already been started in the current session.
193
+ */
194
+ isSDKStarted(): Promise<AFIsStarted>;
195
+ /**
196
+ * Use this method to check whether the AppsFlyer SDK is currently stopped.
197
+ */
198
+ isSDKStopped(): Promise<AFIsStopped>;
191
199
  /**
192
200
  * Disables AppSet ID collection. If called before SDK init, App Set ID will not be collected.
193
201
  * If called after init, App Set ID will be collected but not sent in request payloads.
@@ -14,6 +14,11 @@ exports.AFConstants = void 0;
14
14
  AFConstants["OAOA_CALLBACK"] = "oaoa_callback";
15
15
  AFConstants["UDL_CALLBACK"] = "udl_callback";
16
16
  })(exports.AFConstants || (exports.AFConstants = {}));
17
+ exports.AFPurchaseType = void 0;
18
+ (function (AFPurchaseType) {
19
+ AFPurchaseType["oneTimePurchase"] = "one_time_purchase";
20
+ AFPurchaseType["subscription"] = "subscription";
21
+ })(exports.AFPurchaseType || (exports.AFPurchaseType = {}));
17
22
  exports.MediationNetwork = void 0;
18
23
  (function (MediationNetwork) {
19
24
  MediationNetwork["IRONSOURCE"] = "ironsource";
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/Appsflyer_constants.js","esm/appsflyer_interfaces.js","esm/index.js"],"sourcesContent":["export var AFConstants;\n(function (AFConstants) {\n AFConstants[\"onConversionDataSuccess\"] = \"onConversionDataSuccess\";\n AFConstants[\"onConversionDataFail\"] = \"onConversionDataFail\";\n AFConstants[\"onAppOpenAttribution\"] = \"onAppOpenAttribution\";\n AFConstants[\"onAttributionFailure\"] = \"onAttributionFailure\";\n AFConstants[\"CONVERSION_CALLBACK\"] = \"conversion_callback\";\n AFConstants[\"OAOA_CALLBACK\"] = \"oaoa_callback\";\n AFConstants[\"UDL_CALLBACK\"] = \"udl_callback\";\n})(AFConstants || (AFConstants = {}));\nexport var MediationNetwork;\n(function (MediationNetwork) {\n MediationNetwork[\"IRONSOURCE\"] = \"ironsource\";\n MediationNetwork[\"APPLOVIN_MAX\"] = \"applovin_max\";\n MediationNetwork[\"GOOGLE_ADMOB\"] = \"google_admob\";\n MediationNetwork[\"FYBER\"] = \"fyber\";\n MediationNetwork[\"APPODEAL\"] = \"appodeal\";\n MediationNetwork[\"ADMOST\"] = \"admost\";\n MediationNetwork[\"TOPON\"] = \"topon\";\n MediationNetwork[\"TRADPLUS\"] = \"tradplus\";\n MediationNetwork[\"YANDEX\"] = \"yandex\";\n MediationNetwork[\"CHARTBOOST\"] = \"chartboost\";\n MediationNetwork[\"UNITY\"] = \"unity\";\n MediationNetwork[\"TOPON_PTE\"] = \"topon_pte\";\n MediationNetwork[\"CUSTOM_MEDIATION\"] = \"custom_mediation\";\n MediationNetwork[\"DIRECT_MONETIZATION_NETWORK\"] = \"direct_monetization_network\";\n})(MediationNetwork || (MediationNetwork = {}));\n//# sourceMappingURL=Appsflyer_constants.js.map","class AppsFlyerConsentClass {\n constructor(isUserSubjectToGDPR, hasConsentForDataUsage, hasConsentForAdsPersonalization) {\n this.isUserSubjectToGDPR = isUserSubjectToGDPR;\n this.hasConsentForDataUsage = hasConsentForDataUsage;\n this.hasConsentForAdsPersonalization = hasConsentForAdsPersonalization;\n }\n static forGDPRUser(hasConsentForDataUsage, hasConsentForAdsPersonalization) {\n return new AppsFlyerConsentClass(true, hasConsentForDataUsage, hasConsentForAdsPersonalization);\n }\n static forNonGDPRUser() {\n return new AppsFlyerConsentClass(false);\n }\n}\nexport const AppsFlyerConsent = {\n forGDPRUser: AppsFlyerConsentClass.forGDPRUser,\n forNonGDPRUser: AppsFlyerConsentClass.forNonGDPRUser\n};\n//# sourceMappingURL=appsflyer_interfaces.js.map","import { registerPlugin } from '@capacitor/core';\nconst AppsFlyer = registerPlugin('AppsFlyerPlugin', {});\nexport * from './definitions';\nexport * from './Appsflyer_constants';\nexport * from './appsflyer_interfaces';\nexport { AppsFlyer };\n//# sourceMappingURL=index.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AC,GAAG,OAAO,CAAC;AACxC,IAAI,gBAAgB,CAAC,WAAW,CAAC,GAAG,WAAW,CAAC;AAChD,IAAI,gBAAgB,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAAC;AAC9D,IAAI,gBAAgB,CAAC,6BAA6B,CAAC,GAAG,6BAA6B,CAAC;AACpF,CAAC,EAAEA,wBAAgB,KAAKA,wBAAgB,GAAG,EAAE,CAAC,CAAC;;AC1B/C,MAAM,qBAAqB,CAAC;AAC5B,IAAI,WAAW,CAAC,mBAAmB,EAAE,sBAAsB,EAAE,+BAA+B,EAAE;AAC9F,QAAQ,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;AACvD,QAAQ,IAAI,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;AAC7D,QAAQ,IAAI,CAAC,+BAA+B,GAAG,+BAA+B,CAAC;AAC/E,KAAK;AACL,IAAI,OAAO,WAAW,CAAC,sBAAsB,EAAE,+BAA+B,EAAE;AAChF,QAAQ,OAAO,IAAI,qBAAqB,CAAC,IAAI,EAAE,sBAAsB,EAAE,+BAA+B,CAAC,CAAC;AACxG,KAAK;AACL,IAAI,OAAO,cAAc,GAAG;AAC5B,QAAQ,OAAO,IAAI,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAChD,KAAK;AACL,CAAC;AACW,MAAC,gBAAgB,GAAG;AAChC,IAAI,WAAW,EAAE,qBAAqB,CAAC,WAAW;AAClD,IAAI,cAAc,EAAE,qBAAqB,CAAC,cAAc;AACxD;;ACfK,MAAC,SAAS,GAAGC,mBAAc,CAAC,iBAAiB,EAAE,EAAE;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/Appsflyer_constants.js","esm/appsflyer_interfaces.js","esm/index.js"],"sourcesContent":["export var AFConstants;\n(function (AFConstants) {\n AFConstants[\"onConversionDataSuccess\"] = \"onConversionDataSuccess\";\n AFConstants[\"onConversionDataFail\"] = \"onConversionDataFail\";\n AFConstants[\"onAppOpenAttribution\"] = \"onAppOpenAttribution\";\n AFConstants[\"onAttributionFailure\"] = \"onAttributionFailure\";\n AFConstants[\"CONVERSION_CALLBACK\"] = \"conversion_callback\";\n AFConstants[\"OAOA_CALLBACK\"] = \"oaoa_callback\";\n AFConstants[\"UDL_CALLBACK\"] = \"udl_callback\";\n})(AFConstants || (AFConstants = {}));\nexport var AFPurchaseType;\n(function (AFPurchaseType) {\n AFPurchaseType[\"oneTimePurchase\"] = \"one_time_purchase\";\n AFPurchaseType[\"subscription\"] = \"subscription\";\n})(AFPurchaseType || (AFPurchaseType = {}));\nexport var MediationNetwork;\n(function (MediationNetwork) {\n MediationNetwork[\"IRONSOURCE\"] = \"ironsource\";\n MediationNetwork[\"APPLOVIN_MAX\"] = \"applovin_max\";\n MediationNetwork[\"GOOGLE_ADMOB\"] = \"google_admob\";\n MediationNetwork[\"FYBER\"] = \"fyber\";\n MediationNetwork[\"APPODEAL\"] = \"appodeal\";\n MediationNetwork[\"ADMOST\"] = \"admost\";\n MediationNetwork[\"TOPON\"] = \"topon\";\n MediationNetwork[\"TRADPLUS\"] = \"tradplus\";\n MediationNetwork[\"YANDEX\"] = \"yandex\";\n MediationNetwork[\"CHARTBOOST\"] = \"chartboost\";\n MediationNetwork[\"UNITY\"] = \"unity\";\n MediationNetwork[\"TOPON_PTE\"] = \"topon_pte\";\n MediationNetwork[\"CUSTOM_MEDIATION\"] = \"custom_mediation\";\n MediationNetwork[\"DIRECT_MONETIZATION_NETWORK\"] = \"direct_monetization_network\";\n})(MediationNetwork || (MediationNetwork = {}));\n//# sourceMappingURL=Appsflyer_constants.js.map","class AppsFlyerConsentClass {\n constructor(isUserSubjectToGDPR, hasConsentForDataUsage, hasConsentForAdsPersonalization) {\n this.isUserSubjectToGDPR = isUserSubjectToGDPR;\n this.hasConsentForDataUsage = hasConsentForDataUsage;\n this.hasConsentForAdsPersonalization = hasConsentForAdsPersonalization;\n }\n static forGDPRUser(hasConsentForDataUsage, hasConsentForAdsPersonalization) {\n return new AppsFlyerConsentClass(true, hasConsentForDataUsage, hasConsentForAdsPersonalization);\n }\n static forNonGDPRUser() {\n return new AppsFlyerConsentClass(false);\n }\n}\nexport const AppsFlyerConsent = {\n forGDPRUser: AppsFlyerConsentClass.forGDPRUser,\n forNonGDPRUser: AppsFlyerConsentClass.forNonGDPRUser\n};\n//# sourceMappingURL=appsflyer_interfaces.js.map","import { registerPlugin } from '@capacitor/core';\nconst AppsFlyer = registerPlugin('AppsFlyerPlugin', {});\nexport * from './definitions';\nexport * from './Appsflyer_constants';\nexport * from './appsflyer_interfaces';\nexport { AppsFlyer };\n//# sourceMappingURL=index.js.map"],"names":["AFConstants","AFPurchaseType","MediationNetwork","registerPlugin"],"mappings":";;;;;;AAAWA,6BAAY;AACvB,CAAC,UAAU,WAAW,EAAE;AACxB,IAAI,WAAW,CAAC,yBAAyB,CAAC,GAAG,yBAAyB,CAAC;AACvE,IAAI,WAAW,CAAC,sBAAsB,CAAC,GAAG,sBAAsB,CAAC;AACjE,IAAI,WAAW,CAAC,sBAAsB,CAAC,GAAG,sBAAsB,CAAC;AACjE,IAAI,WAAW,CAAC,sBAAsB,CAAC,GAAG,sBAAsB,CAAC;AACjE,IAAI,WAAW,CAAC,qBAAqB,CAAC,GAAG,qBAAqB,CAAC;AAC/D,IAAI,WAAW,CAAC,eAAe,CAAC,GAAG,eAAe,CAAC;AACnD,IAAI,WAAW,CAAC,cAAc,CAAC,GAAG,cAAc,CAAC;AACjD,CAAC,EAAEA,mBAAW,KAAKA,mBAAW,GAAG,EAAE,CAAC,CAAC,CAAC;AAC3BC,gCAAe;AAC1B,CAAC,UAAU,cAAc,EAAE;AAC3B,IAAI,cAAc,CAAC,iBAAiB,CAAC,GAAG,mBAAmB,CAAC;AAC5D,IAAI,cAAc,CAAC,cAAc,CAAC,GAAG,cAAc,CAAC;AACpD,CAAC,EAAEA,sBAAc,KAAKA,sBAAc,GAAG,EAAE,CAAC,CAAC,CAAC;AACjCC,kCAAiB;AAC5B,CAAC,UAAU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AChF,QAAQ,OAAO,IAAI,qBAAqB,CAAC,IAAI,EAAE,sBAAsB,EAAE,+BAA+B,CAAC,CAAC;AACxG,KAAK;AACL,IAAI,OAAO,cAAc,GAAG;AAC5B,QAAQ,OAAO,IAAI,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAChD,KAAK;AACL,CAAC;AACW,MAAC,gBAAgB,GAAG;AAChC,IAAI,WAAW,EAAE,qBAAqB,CAAC,WAAW;AAClD,IAAI,cAAc,EAAE,qBAAqB,CAAC,cAAc;AACxD;;ACfK,MAAC,SAAS,GAAGC,mBAAc,CAAC,iBAAiB,EAAE,EAAE;;;;;"}
package/dist/plugin.js CHANGED
@@ -11,6 +11,11 @@ var AppsFlyerCapacitorPlugin = (function (exports, core) {
11
11
  AFConstants["OAOA_CALLBACK"] = "oaoa_callback";
12
12
  AFConstants["UDL_CALLBACK"] = "udl_callback";
13
13
  })(exports.AFConstants || (exports.AFConstants = {}));
14
+ exports.AFPurchaseType = void 0;
15
+ (function (AFPurchaseType) {
16
+ AFPurchaseType["oneTimePurchase"] = "one_time_purchase";
17
+ AFPurchaseType["subscription"] = "subscription";
18
+ })(exports.AFPurchaseType || (exports.AFPurchaseType = {}));
14
19
  exports.MediationNetwork = void 0;
15
20
  (function (MediationNetwork) {
16
21
  MediationNetwork["IRONSOURCE"] = "ironsource";
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/Appsflyer_constants.js","esm/appsflyer_interfaces.js","esm/index.js"],"sourcesContent":["export var AFConstants;\n(function (AFConstants) {\n AFConstants[\"onConversionDataSuccess\"] = \"onConversionDataSuccess\";\n AFConstants[\"onConversionDataFail\"] = \"onConversionDataFail\";\n AFConstants[\"onAppOpenAttribution\"] = \"onAppOpenAttribution\";\n AFConstants[\"onAttributionFailure\"] = \"onAttributionFailure\";\n AFConstants[\"CONVERSION_CALLBACK\"] = \"conversion_callback\";\n AFConstants[\"OAOA_CALLBACK\"] = \"oaoa_callback\";\n AFConstants[\"UDL_CALLBACK\"] = \"udl_callback\";\n})(AFConstants || (AFConstants = {}));\nexport var MediationNetwork;\n(function (MediationNetwork) {\n MediationNetwork[\"IRONSOURCE\"] = \"ironsource\";\n MediationNetwork[\"APPLOVIN_MAX\"] = \"applovin_max\";\n MediationNetwork[\"GOOGLE_ADMOB\"] = \"google_admob\";\n MediationNetwork[\"FYBER\"] = \"fyber\";\n MediationNetwork[\"APPODEAL\"] = \"appodeal\";\n MediationNetwork[\"ADMOST\"] = \"admost\";\n MediationNetwork[\"TOPON\"] = \"topon\";\n MediationNetwork[\"TRADPLUS\"] = \"tradplus\";\n MediationNetwork[\"YANDEX\"] = \"yandex\";\n MediationNetwork[\"CHARTBOOST\"] = \"chartboost\";\n MediationNetwork[\"UNITY\"] = \"unity\";\n MediationNetwork[\"TOPON_PTE\"] = \"topon_pte\";\n MediationNetwork[\"CUSTOM_MEDIATION\"] = \"custom_mediation\";\n MediationNetwork[\"DIRECT_MONETIZATION_NETWORK\"] = \"direct_monetization_network\";\n})(MediationNetwork || (MediationNetwork = {}));\n//# sourceMappingURL=Appsflyer_constants.js.map","class AppsFlyerConsentClass {\n constructor(isUserSubjectToGDPR, hasConsentForDataUsage, hasConsentForAdsPersonalization) {\n this.isUserSubjectToGDPR = isUserSubjectToGDPR;\n this.hasConsentForDataUsage = hasConsentForDataUsage;\n this.hasConsentForAdsPersonalization = hasConsentForAdsPersonalization;\n }\n static forGDPRUser(hasConsentForDataUsage, hasConsentForAdsPersonalization) {\n return new AppsFlyerConsentClass(true, hasConsentForDataUsage, hasConsentForAdsPersonalization);\n }\n static forNonGDPRUser() {\n return new AppsFlyerConsentClass(false);\n }\n}\nexport const AppsFlyerConsent = {\n forGDPRUser: AppsFlyerConsentClass.forGDPRUser,\n forNonGDPRUser: AppsFlyerConsentClass.forNonGDPRUser\n};\n//# sourceMappingURL=appsflyer_interfaces.js.map","import { registerPlugin } from '@capacitor/core';\nconst AppsFlyer = registerPlugin('AppsFlyerPlugin', {});\nexport * from './definitions';\nexport * from './Appsflyer_constants';\nexport * from './appsflyer_interfaces';\nexport { AppsFlyer };\n//# sourceMappingURL=index.js.map"],"names":["AFConstants","MediationNetwork","registerPlugin"],"mappings":";;;AAAWA,iCAAY;IACvB,CAAC,UAAU,WAAW,EAAE;IACxB,IAAI,WAAW,CAAC,yBAAyB,CAAC,GAAG,yBAAyB,CAAC;IACvE,IAAI,WAAW,CAAC,sBAAsB,CAAC,GAAG,sBAAsB,CAAC;IACjE,IAAI,WAAW,CAAC,sBAAsB,CAAC,GAAG,sBAAsB,CAAC;IACjE,IAAI,WAAW,CAAC,sBAAsB,CAAC,GAAG,sBAAsB,CAAC;IACjE,IAAI,WAAW,CAAC,qBAAqB,CAAC,GAAG,qBAAqB,CAAC;IAC/D,IAAI,WAAW,CAAC,eAAe,CAAC,GAAG,eAAe,CAAC;IACnD,IAAI,WAAW,CAAC,cAAc,CAAC,GAAG,cAAc,CAAC;IACjD,CAAC,EAAEA,mBAAW,KAAKA,mBAAW,GAAG,EAAE,CAAC,CAAC,CAAC;AAC3BC,sCAAiB;IAC5B,CAAC,UAAU,gBAAgB,EAAE;IAC7B,IAAI,gBAAgB,CAAC,YAAY,CAAC,GAAG,YAAY,CAAC;IAClD,IAAI,gBAAgB,CAAC,cAAc,CAAC,GAAG,cAAc,CAAC;IACtD,IAAI,gBAAgB,CAAC,cAAc,CAAC,GAAG,cAAc,CAAC;IACtD,IAAI,gBAAgB,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACxC,IAAI,gBAAgB,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;IAC9C,IAAI,gBAAgB,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;IAC1C,IAAI,gBAAgB,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACxC,IAAI,gBAAgB,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;IAC9C,IAAI,gBAAgB,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;IAC1C,IAAI,gBAAgB,CAAC,YAAY,CAAC,GAAG,YAAY,CAAC;IAClD,IAAI,gBAAgB,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACxC,IAAI,gBAAgB,CAAC,WAAW,CAAC,GAAG,WAAW,CAAC;IAChD,IAAI,gBAAgB,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAAC;IAC9D,IAAI,gBAAgB,CAAC,6BAA6B,CAAC,GAAG,6BAA6B,CAAC;IACpF,CAAC,EAAEA,wBAAgB,KAAKA,wBAAgB,GAAG,EAAE,CAAC,CAAC;;IC1B/C,MAAM,qBAAqB,CAAC;IAC5B,IAAI,WAAW,CAAC,mBAAmB,EAAE,sBAAsB,EAAE,+BAA+B,EAAE;IAC9F,QAAQ,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;IACvD,QAAQ,IAAI,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;IAC7D,QAAQ,IAAI,CAAC,+BAA+B,GAAG,+BAA+B,CAAC;IAC/E,KAAK;IACL,IAAI,OAAO,WAAW,CAAC,sBAAsB,EAAE,+BAA+B,EAAE;IAChF,QAAQ,OAAO,IAAI,qBAAqB,CAAC,IAAI,EAAE,sBAAsB,EAAE,+BAA+B,CAAC,CAAC;IACxG,KAAK;IACL,IAAI,OAAO,cAAc,GAAG;IAC5B,QAAQ,OAAO,IAAI,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAChD,KAAK;IACL,CAAC;AACW,UAAC,gBAAgB,GAAG;IAChC,IAAI,WAAW,EAAE,qBAAqB,CAAC,WAAW;IAClD,IAAI,cAAc,EAAE,qBAAqB,CAAC,cAAc;IACxD;;ACfK,UAAC,SAAS,GAAGC,mBAAc,CAAC,iBAAiB,EAAE,EAAE;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/Appsflyer_constants.js","esm/appsflyer_interfaces.js","esm/index.js"],"sourcesContent":["export var AFConstants;\n(function (AFConstants) {\n AFConstants[\"onConversionDataSuccess\"] = \"onConversionDataSuccess\";\n AFConstants[\"onConversionDataFail\"] = \"onConversionDataFail\";\n AFConstants[\"onAppOpenAttribution\"] = \"onAppOpenAttribution\";\n AFConstants[\"onAttributionFailure\"] = \"onAttributionFailure\";\n AFConstants[\"CONVERSION_CALLBACK\"] = \"conversion_callback\";\n AFConstants[\"OAOA_CALLBACK\"] = \"oaoa_callback\";\n AFConstants[\"UDL_CALLBACK\"] = \"udl_callback\";\n})(AFConstants || (AFConstants = {}));\nexport var AFPurchaseType;\n(function (AFPurchaseType) {\n AFPurchaseType[\"oneTimePurchase\"] = \"one_time_purchase\";\n AFPurchaseType[\"subscription\"] = \"subscription\";\n})(AFPurchaseType || (AFPurchaseType = {}));\nexport var MediationNetwork;\n(function (MediationNetwork) {\n MediationNetwork[\"IRONSOURCE\"] = \"ironsource\";\n MediationNetwork[\"APPLOVIN_MAX\"] = \"applovin_max\";\n MediationNetwork[\"GOOGLE_ADMOB\"] = \"google_admob\";\n MediationNetwork[\"FYBER\"] = \"fyber\";\n MediationNetwork[\"APPODEAL\"] = \"appodeal\";\n MediationNetwork[\"ADMOST\"] = \"admost\";\n MediationNetwork[\"TOPON\"] = \"topon\";\n MediationNetwork[\"TRADPLUS\"] = \"tradplus\";\n MediationNetwork[\"YANDEX\"] = \"yandex\";\n MediationNetwork[\"CHARTBOOST\"] = \"chartboost\";\n MediationNetwork[\"UNITY\"] = \"unity\";\n MediationNetwork[\"TOPON_PTE\"] = \"topon_pte\";\n MediationNetwork[\"CUSTOM_MEDIATION\"] = \"custom_mediation\";\n MediationNetwork[\"DIRECT_MONETIZATION_NETWORK\"] = \"direct_monetization_network\";\n})(MediationNetwork || (MediationNetwork = {}));\n//# sourceMappingURL=Appsflyer_constants.js.map","class AppsFlyerConsentClass {\n constructor(isUserSubjectToGDPR, hasConsentForDataUsage, hasConsentForAdsPersonalization) {\n this.isUserSubjectToGDPR = isUserSubjectToGDPR;\n this.hasConsentForDataUsage = hasConsentForDataUsage;\n this.hasConsentForAdsPersonalization = hasConsentForAdsPersonalization;\n }\n static forGDPRUser(hasConsentForDataUsage, hasConsentForAdsPersonalization) {\n return new AppsFlyerConsentClass(true, hasConsentForDataUsage, hasConsentForAdsPersonalization);\n }\n static forNonGDPRUser() {\n return new AppsFlyerConsentClass(false);\n }\n}\nexport const AppsFlyerConsent = {\n forGDPRUser: AppsFlyerConsentClass.forGDPRUser,\n forNonGDPRUser: AppsFlyerConsentClass.forNonGDPRUser\n};\n//# sourceMappingURL=appsflyer_interfaces.js.map","import { registerPlugin } from '@capacitor/core';\nconst AppsFlyer = registerPlugin('AppsFlyerPlugin', {});\nexport * from './definitions';\nexport * from './Appsflyer_constants';\nexport * from './appsflyer_interfaces';\nexport { AppsFlyer };\n//# sourceMappingURL=index.js.map"],"names":["AFConstants","AFPurchaseType","MediationNetwork","registerPlugin"],"mappings":";;;AAAWA,iCAAY;IACvB,CAAC,UAAU,WAAW,EAAE;IACxB,IAAI,WAAW,CAAC,yBAAyB,CAAC,GAAG,yBAAyB,CAAC;IACvE,IAAI,WAAW,CAAC,sBAAsB,CAAC,GAAG,sBAAsB,CAAC;IACjE,IAAI,WAAW,CAAC,sBAAsB,CAAC,GAAG,sBAAsB,CAAC;IACjE,IAAI,WAAW,CAAC,sBAAsB,CAAC,GAAG,sBAAsB,CAAC;IACjE,IAAI,WAAW,CAAC,qBAAqB,CAAC,GAAG,qBAAqB,CAAC;IAC/D,IAAI,WAAW,CAAC,eAAe,CAAC,GAAG,eAAe,CAAC;IACnD,IAAI,WAAW,CAAC,cAAc,CAAC,GAAG,cAAc,CAAC;IACjD,CAAC,EAAEA,mBAAW,KAAKA,mBAAW,GAAG,EAAE,CAAC,CAAC,CAAC;AAC3BC,oCAAe;IAC1B,CAAC,UAAU,cAAc,EAAE;IAC3B,IAAI,cAAc,CAAC,iBAAiB,CAAC,GAAG,mBAAmB,CAAC;IAC5D,IAAI,cAAc,CAAC,cAAc,CAAC,GAAG,cAAc,CAAC;IACpD,CAAC,EAAEA,sBAAc,KA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AC;IAC/E,KAAK;IACL,IAAI,OAAO,WAAW,CAAC,sBAAsB,EAAE,+BAA+B,EAAE;IAChF,QAAQ,OAAO,IAAI,qBAAqB,CAAC,IAAI,EAAE,sBAAsB,EAAE,+BAA+B,CAAC,CAAC;IACxG,KAAK;IACL,IAAI,OAAO,cAAc,GAAG;IAC5B,QAAQ,OAAO,IAAI,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAChD,KAAK;IACL,CAAC;AACW,UAAC,gBAAgB,GAAG;IAChC,IAAI,WAAW,EAAE,qBAAqB,CAAC,WAAW;IAClD,IAAI,cAAc,EAAE,qBAAqB,CAAC,cAAc;IACxD;;ACfK,UAAC,SAAS,GAAGC,mBAAc,CAAC,iBAAiB,EAAE,EAAE;;;;;;;;;;;;;"}
@@ -78,4 +78,8 @@ class AppsFlyerConstants {
78
78
  static let AF_CURRENCY_ISO4217_CODE = "currencyIso4217Code"
79
79
  static let AF_REVENUE = "revenue"
80
80
  static let AF_MEDIATION_NETWORK = "mediationNetwork"
81
+ static let AF_PURCHASE_DETAILS = "purchaseDetails"
82
+ static let AF_PURCHASE_TYPE = "purchaseType"
83
+ static let AF_PURCHASE_TOKEN = "purchaseToken"
84
+ static let AF_PRODUCT_ID = "productId"
81
85
  }
@@ -26,6 +26,7 @@ CAP_PLUGIN(AppsFlyerPlugin, "AppsFlyerPlugin",
26
26
  CAP_PLUGIN_METHOD(setHost, CAPPluginReturnNone);
27
27
  CAP_PLUGIN_METHOD(generateInviteLink, CAPPluginReturnPromise);
28
28
  CAP_PLUGIN_METHOD(validateAndLogInAppPurchaseAndroid, CAPPluginReturnPromise);
29
+ CAP_PLUGIN_METHOD(disableAppSetId, CAPPluginReturnNone);
29
30
  CAP_PLUGIN_METHOD(validateAndLogInAppPurchaseIos, CAPPluginReturnPromise);
30
31
  CAP_PLUGIN_METHOD(getSdkVersion, CAPPluginReturnPromise);
31
32
  CAP_PLUGIN_METHOD(enableFacebookDeferredApplinks, CAPPluginReturnPromise);
@@ -43,6 +44,9 @@ CAP_PLUGIN(AppsFlyerPlugin, "AppsFlyerPlugin",
43
44
  CAP_PLUGIN_METHOD(startSDK, CAPPluginReturnPromise);
44
45
  CAP_PLUGIN_METHOD(logAdRevenue, CAPPluginReturnNone);
45
46
  CAP_PLUGIN_METHOD(setConsentDataV2, CAPPluginReturnNone);
47
+ CAP_PLUGIN_METHOD(isSDKStarted, CAPPluginReturnPromise);
48
+ CAP_PLUGIN_METHOD(isSDKStopped, CAPPluginReturnPromise);
49
+ CAP_PLUGIN_METHOD(validateAndLogInAppPurchaseV2, CAPPluginReturnPromise);
46
50
 
47
51
 
48
52
 
@@ -5,10 +5,11 @@ import AppsFlyerLib
5
5
 
6
6
  @objc(AppsFlyerPlugin)
7
7
  public class AppsFlyerPlugin: CAPPlugin {
8
- private let APPSFLYER_PLUGIN_VERSION = "6.17.0"
8
+ private let APPSFLYER_PLUGIN_VERSION = "6.17.5-RC1"
9
9
  private var conversion = true
10
10
  private var oaoa = true
11
11
  private var udl = false
12
+ private var hasSDKStarted: Bool = false
12
13
 
13
14
  override public func load() {
14
15
 
@@ -109,7 +110,6 @@ public class AppsFlyerPlugin: CAPPlugin {
109
110
  }
110
111
 
111
112
  @objc func startSDK(_ call: CAPPluginCall) {
112
-
113
113
  NotificationCenter.default
114
114
  .addObserver(
115
115
  self,
@@ -118,10 +118,11 @@ public class AppsFlyerPlugin: CAPPlugin {
118
118
  object: nil
119
119
  )
120
120
 
121
- AppsFlyerLib.shared().start { dictionary, error in
121
+ AppsFlyerLib.shared().start { [weak self] dictionary, error in
122
122
  if let error = error {
123
123
  call.reject(error.localizedDescription)
124
124
  } else {
125
+ self?.hasSDKStarted = true
125
126
  call.resolve(["res": "success"])
126
127
  }
127
128
  }
@@ -420,19 +421,19 @@ public class AppsFlyerPlugin: CAPPlugin {
420
421
 
421
422
  call.resolve()
422
423
  }
423
-
424
+
424
425
  @objc func setConsentDataV2(_ call: CAPPluginCall) {
425
426
  // inner helper: convert Bool? to NSNumber?
426
427
  func toNSNumber(_ value: Bool?) -> NSNumber? {
427
428
  guard let value = value else { return nil }
428
429
  return NSNumber(value: value)
429
430
  }
430
-
431
+
431
432
  let isUserSubjectToGDPR = toNSNumber(call.getBool(AppsFlyerConstants.AF_IS_SUBJECTED_TO_DGPR))
432
433
  let hasConsentForDataUsage = toNSNumber(call.getBool(AppsFlyerConstants.AF_CONSENT_FOR_DATA_USAGE))
433
434
  let hasConsentForAdsPersonalization = toNSNumber(call.getBool(AppsFlyerConstants.AF_CONSENT_FOR_ADS_PERSONALIZATION))
434
435
  let hasConsentForAdStorage = toNSNumber(call.getBool(AppsFlyerConstants.AF_CONSENT_FOR_ADS_STORAGE))
435
-
436
+
436
437
  // Build consent options object and pass to AppsFlyer SDK
437
438
  let consentOptions = AppsFlyerConsent(
438
439
  isUserSubjectToGDPR: isUserSubjectToGDPR,
@@ -440,7 +441,7 @@ public class AppsFlyerPlugin: CAPPlugin {
440
441
  hasConsentForAdsPersonalization: hasConsentForAdsPersonalization,
441
442
  hasConsentForAdStorage: hasConsentForAdStorage
442
443
  )
443
-
444
+
444
445
  AppsFlyerLib.shared().setConsentData(consentOptions)
445
446
  call.resolve()
446
447
  }
@@ -505,54 +506,54 @@ public class AppsFlyerPlugin: CAPPlugin {
505
506
 
506
507
  @objc func generateInviteLink(_ call: CAPPluginCall){
507
508
  AppsFlyerShareInviteHelper.generateInviteUrl(
508
- linkGenerator:
509
- {(
510
- _ generator: AppsFlyerLinkGenerator
511
- ) -> AppsFlyerLinkGenerator in
512
- if let channel = call.getString(AppsFlyerConstants.AF_CHANNEL){
513
- generator.setChannel(channel)
514
- }
515
- if let brandDomain = call.getString(AppsFlyerConstants.AF_BRAND_DOMAIN){
516
- generator.brandDomain = brandDomain
517
- }
518
- if let campaign = call.getString(AppsFlyerConstants.AF_CAMPAIGN){
519
- generator.setCampaign(campaign)
520
- }
521
- if let referrerName = call.getString(
522
- AppsFlyerConstants.AF_REFERRER_NAME
523
- ){
524
- generator.setReferrerName(referrerName)
525
- }
526
- if let referrerImageURL = call.getString(
527
- AppsFlyerConstants.AF_REFERRER_IMAGE_URL
528
- ){
529
- generator.setReferrerImageURL(referrerImageURL)
530
- }
531
- if let referrerCustomerId = call.getString(
532
- AppsFlyerConstants.AF_REFERRER_CUSTOMER_ID
533
- ){
534
- generator.setReferrerCustomerId(referrerCustomerId)
535
- }
536
- if let baseDeeplink = call.getString(
537
- AppsFlyerConstants.AF_BASE_DEEPLINK
538
- ){
539
- generator.setBaseDeeplink(baseDeeplink)
540
- }
541
- if let addParameters = call.getObject(
542
- AppsFlyerConstants.AF_ADD_PARAMETERS
543
- ){
544
- generator.addParameters(addParameters)
545
- }
546
-
547
- return generator
548
- },
549
- completionHandler: {url in
550
- if url != nil{
551
- call.resolve([AppsFlyerConstants.AF_LINK_READY: url!.absoluteString])
552
- }else{
553
- call.reject("Failed to generate a link")
554
- }
555
- }
509
+ linkGenerator:
510
+ {(
511
+ _ generator: AppsFlyerLinkGenerator
512
+ ) -> AppsFlyerLinkGenerator in
513
+ if let channel = call.getString(AppsFlyerConstants.AF_CHANNEL){
514
+ generator.setChannel(channel)
515
+ }
516
+ if let brandDomain = call.getString(AppsFlyerConstants.AF_BRAND_DOMAIN){
517
+ generator.brandDomain = brandDomain
518
+ }
519
+ if let campaign = call.getString(AppsFlyerConstants.AF_CAMPAIGN){
520
+ generator.setCampaign(campaign)
521
+ }
522
+ if let referrerName = call.getString(
523
+ AppsFlyerConstants.AF_REFERRER_NAME
524
+ ){
525
+ generator.setReferrerName(referrerName)
526
+ }
527
+ if let referrerImageURL = call.getString(
528
+ AppsFlyerConstants.AF_REFERRER_IMAGE_URL
529
+ ){
530
+ generator.setReferrerImageURL(referrerImageURL)
531
+ }
532
+ if let referrerCustomerId = call.getString(
533
+ AppsFlyerConstants.AF_REFERRER_CUSTOMER_ID
534
+ ){
535
+ generator.setReferrerCustomerId(referrerCustomerId)
536
+ }
537
+ if let baseDeeplink = call.getString(
538
+ AppsFlyerConstants.AF_BASE_DEEPLINK
539
+ ){
540
+ generator.setBaseDeeplink(baseDeeplink)
541
+ }
542
+ if let addParameters = call.getObject(
543
+ AppsFlyerConstants.AF_ADD_PARAMETERS
544
+ ){
545
+ generator.addParameters(addParameters)
546
+ }
547
+
548
+ return generator
549
+ },
550
+ completionHandler: {url in
551
+ if url != nil{
552
+ call.resolve([AppsFlyerConstants.AF_LINK_READY: url!.absoluteString])
553
+ }else{
554
+ call.reject("Failed to generate a link")
555
+ }
556
+ }
556
557
  )
557
558
 
558
559
  }
@@ -737,6 +738,97 @@ completionHandler: {url in
737
738
  call.resolve(["res": "ok"])
738
739
 
739
740
  }
741
+
742
+ /**
743
+ * Returns whether the AppsFlyer SDK has been started in the current session.
744
+ */
745
+ @objc func isSDKStarted(_ call: CAPPluginCall) {
746
+ call.resolve(["isStarted": hasSDKStarted])
747
+ }
748
+
749
+ /**
750
+ * Returns whether the AppsFlyer SDK is currently stopped.
751
+ */
752
+ @objc func isSDKStopped(_ call: CAPPluginCall) {
753
+ call.resolve(["isStopped": AppsFlyerLib.shared().isStopped])
754
+ }
755
+
756
+ @objc func disableAppSetId(_ call: CAPPluginCall){
757
+ call.unavailable()
758
+ }
759
+
760
+ @objc func validateAndLogInAppPurchaseV2(_ call: CAPPluginCall) {
761
+ guard let purchaseDetailsMap = call.getObject(AppsFlyerConstants.AF_PURCHASE_DETAILS) else {
762
+ call.reject("Purchase details are required")
763
+ return
764
+ }
765
+
766
+ let additionalParameters = call.getObject(AppsFlyerConstants.AF_ADDITIONAL_PARAMETERS)
767
+
768
+ // Validate required fields
769
+ guard let purchaseTypeString = purchaseDetailsMap[AppsFlyerConstants.AF_PURCHASE_TYPE] as? String else {
770
+ call.reject("Purchase type is required")
771
+ return
772
+ }
773
+ guard let purchaseType = mapPurchaseType(purchaseTypeString) else {
774
+ call.reject("Unkown purchase type")
775
+ return
776
+ }
777
+
778
+ guard let purchaseToken = purchaseDetailsMap[AppsFlyerConstants.AF_PURCHASE_TOKEN] as? String else {
779
+ call.reject("Purchase token is required")
780
+ return
781
+ }
782
+
783
+ guard let productId = purchaseDetailsMap[AppsFlyerConstants.AF_PRODUCT_ID] as? String else {
784
+ call.reject("Product ID is required")
785
+ return
786
+ }
787
+
788
+ // Create a new instance of AFSDKPurchaseDetails with the required information
789
+ let purchaseDetails: AFSDKPurchaseDetails = AFSDKPurchaseDetails(
790
+ productId: productId,
791
+ transactionId: purchaseToken,
792
+ purchaseType: purchaseType
793
+ )
794
+
795
+
796
+ // For iOS, we use the existing validateAndLog method with the new V2 parameters
797
+ // The purchaseToken serves as the transactionId for iOS
798
+ AppsFlyerLib.shared().validateAndLogInAppPurchase(purchaseDetails: purchaseDetails, purchaseAdditionalDetails: additionalParameters){result, error in
799
+ if result != nil {
800
+ var response: [String: Any] = [:]
801
+ if let resultDict = result as? [String: Any] {
802
+ response = resultDict
803
+ } else {
804
+ response["result"] = result
805
+ }
806
+ call.resolve(response)
807
+ } else if error != nil {
808
+ var errorDict: [String: Any] = [:]
809
+ if let nsError = error as NSError? {
810
+ errorDict["error"] = nsError.localizedDescription
811
+ errorDict["code"] = nsError.code
812
+ errorDict["userInfo"] = nsError.userInfo
813
+ errorDict["domain"] = nsError.domain // optional, often useful
814
+ }
815
+ call.reject("Validation failed", errorDict.jsonStringRepresentation ?? "")
816
+ }
817
+ }
818
+ }
819
+
820
+ func mapPurchaseType(_ purchaseTypeString: String) -> AFSDKPurchaseType? {
821
+ switch purchaseTypeString {
822
+ case "subscription":
823
+ return .subscription
824
+
825
+ case "one_time_purchase":
826
+ return .oneTimePurchase
827
+
828
+ default:
829
+ return nil
830
+ }
831
+ }
740
832
  }
741
833
 
742
834
  extension AppsFlyerPlugin{
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "appsflyer-capacitor-plugin",
3
- "version": "6.17.0",
4
- "iosSdkVersion": "6.17.0",
5
- "androidSdkVersion": "6.17.0",
6
- "buildNumber": "25",
3
+ "version": "6.17.5-RC1",
4
+ "iosSdkVersion": "6.17.5",
5
+ "androidSdkVersion": "6.17.3",
6
+ "buildNumber": "118",
7
7
  "description": "AppsFlyer SDK plugin for Capacitor",
8
8
  "main": "dist/plugin.cjs.js",
9
9
  "module": "dist/esm/index.js",
@@ -9,6 +9,11 @@ export enum AFConstants {
9
9
  }
10
10
 
11
11
 
12
+ export enum AFPurchaseType {
13
+ oneTimePurchase = 'one_time_purchase',
14
+ subscription = 'subscription'
15
+ }
16
+
12
17
  export enum MediationNetwork {
13
18
  IRONSOURCE = "ironsource",
14
19
  APPLOVIN_MAX = "applovin_max",
@@ -1,4 +1,4 @@
1
- import type {MediationNetwork} from "./Appsflyer_constants";
1
+ import type {MediationNetwork, AFPurchaseType} from "./Appsflyer_constants";
2
2
 
3
3
  export interface AFInit{
4
4
  devKey: string;
@@ -165,3 +165,16 @@ export interface AFConsentOptions {
165
165
  hasConsentForAdsPersonalization?: boolean | null;
166
166
  hasConsentForAdStorage?: boolean | null;
167
167
  }
168
+
169
+ export interface AFIsStarted {isStarted: boolean}
170
+
171
+ export interface AFPurchaseDetails {
172
+ purchaseType: AFPurchaseType;
173
+ purchaseToken: string;
174
+ productId: string;
175
+ }
176
+
177
+ export interface AFPurchaseDetailsV2 {
178
+ purchaseDetails: AFPurchaseDetails;
179
+ additionalParameters?: StringMap;
180
+ }
@@ -40,8 +40,8 @@ import type {
40
40
  AFEnableTCFDataCollection,
41
41
  AFConsentData,
42
42
  AFAdRevenueData,
43
- AFConsentOptions
44
-
43
+ AFConsentOptions,
44
+ AFIsStarted,
45
45
  } from "./appsflyer_interfaces";
46
46
 
47
47
  export interface AppsFlyerPlugin {
@@ -286,10 +286,33 @@ export interface AppsFlyerPlugin {
286
286
  */
287
287
  setConsentDataV2(options: AFConsentOptions): Promise<void>
288
288
 
289
+ /**
290
+ * Use this method to check whether the AppsFlyer SDK has already been started in the current session.
291
+ */
292
+ isSDKStarted(): Promise<AFIsStarted>
293
+
294
+ /**
295
+ * Use this method to check whether the AppsFlyer SDK is currently stopped.
296
+ */
297
+ isSDKStopped(): Promise<AFIsStopped>
298
+
289
299
  /**
290
300
  * Disables AppSet ID collection. If called before SDK init, App Set ID will not be collected.
291
301
  * If called after init, App Set ID will be collected but not sent in request payloads.
292
302
  * Android only.
293
303
  */
294
304
  disableAppSetId(): Promise<void>
305
+
306
+ // TODO: Uncomment this once the API is stable
307
+ // /**
308
+ // * API for server verification of in-app purchases V2 (Beta).
309
+ // * An af_purchase event with the relevant values will be automatically logged if the validation is successful.
310
+ // *
311
+ // * @param data - Object containing purchaseDetails and optional additionalParameters
312
+ // * @returns Promise that resolves with validation result
313
+ // *
314
+ // * ⚠️ **BETA Feature**: This API is currently in beta. While it's stable and recommended for new implementations,
315
+ // * please test thoroughly in your environment before production use.
316
+ // */
317
+ // validateAndLogInAppPurchaseV2(data: AFPurchaseDetailsV2): Promise<{ [key: string]: any }>;
295
318
  }