From 709049f2e77455723c62f248e327e37e2ca8ddb2 Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Tue, 19 Dec 2023 22:13:31 +0100 Subject: [PATCH] feat(adjust): update wrapper for Adjust Cordova SDK v4.35.1 (#4696) * feat(diagnostics): add missing constants and methods for latest plugin version (#4600) * feat(cordova-plugin-firebase-model): Add new plugin to download and process ML model hosted in firebase. (#4608) * feat(unvired-cordova-sdk): Add new function to regenrate the JWT Token * feat(unvired-cordova-sdk): Add couple of properties to login parameters. * feat(cordova-plugin-firebase-model): Add new plugin for downloading and processing ML model hosted in Firebase. * fix(cordova-plugin-unvired-sdk): revert last set of changes. * fix(cordova-plugin-unvired-sdk): Add two new login properties. * fix(cordova-plugin-firebase-model): Delete the previously added plugin. * Revert "fix(cordova-plugin-firebase-model): Delete the previously added plugin." This reverts commit 86f39dc7e83d82a707c74034a1384602531b34e9. * Revert "fix(cordova-plugin-unvired-sdk): Add two new login properties." This reverts commit a79f31e12e1025b9fdde736e4933ee3a749c18bb. * feat(clevertap): support clevertap-cordova 2.7.0 (#4617) [skip ci] * feat(clevertap): add CleverTap plugin * style(clevertap): cleanup stray lint error * refactor * feat(clevertap): update for latest CleverTap Cordova plugin * chore: Update Repo from Ionic Native Repo * fix: Code Changes for parity SDK-155 * fix: Indentation fixes for SDK-155 * fix: Code Repo fix while updating fork branch * fix: Remove unnecessary adder .scripts Folder * fix: Remove unwanted added folder .circleci * fix: Remove unwanted added File .npmrc * fix: Revert .Github Folder Changes to as per Ionic-Native master * fix: Update changes as per ionic-native master * fix: Code Repo fix while updating fork branch fix: Remove unnecessary adder .scripts Folder fix: Remove unwanted added folder .circleci fix: Remove unwanted added File .npmrc fix: Revert .Github Folder Changes to as per Ionic-Native master fix: Update changes as per ionic-native master * fix(CleverTap): Fix for missing methods issue #3491 * refactor(profile): remove setProfile methods for fb and google * refactor(dynamic variables): remove Product A/B Testing (Dynamic Variables) code * fix(product config): add key param to product config getters * feat(identity): add a new public method getCleverTapID and deprecate existing CleverTapID methods * feat(profile): add public methods to increment/decrement values set via User properties * feat(profile): add public methods to increment/decrement values set via User properties * feat(inapp): add public methods for suspending/discarding & resuming InApp Notifications * feat(inbox): add new api for iOS to delete bulk inbox messages for given message ids * refactor(xiaomi-push): add region as an extra mandatory parameter to setPushXiaomiToken * Update index.ts to support cordova 2.7.0 * Update index.ts --------- Co-authored-by: Peter Wilkniss Co-authored-by: Daniel Sogl Co-authored-by: Darshan Pania Co-authored-by: Surya Co-authored-by: SuryaClevertap <63039490+SuryaClevertap@users.noreply.github.com> Co-authored-by: Piyush Kukadiya Co-authored-by: piyush-kukadiya <61137760+piyush-kukadiya@users.noreply.github.com> * feat(save-dialog): add plugin (#4618) * smtp-client * fix plugin ref * cloud settings * + save-dialog --------- Co-authored-by: Daniel Sogl * feat(adjust): update wrapper for Adjust Cordova SDK v4.35.1 * fix(adjust): rename duplicated AdjustAppStorePurchase class member --------- Co-authored-by: Dave Alden Co-authored-by: Srinidhi Co-authored-by: AishwaryaNanna <97506871+AishwaryaNanna@users.noreply.github.com> Co-authored-by: Peter Wilkniss Co-authored-by: Darshan Pania Co-authored-by: Surya Co-authored-by: SuryaClevertap <63039490+SuryaClevertap@users.noreply.github.com> Co-authored-by: Piyush Kukadiya Co-authored-by: piyush-kukadiya <61137760+piyush-kukadiya@users.noreply.github.com> Co-authored-by: marysuon Co-authored-by: uerceg --- .../plugins/adjust/index.ts | 112 ++++++++++++++++-- 1 file changed, 103 insertions(+), 9 deletions(-) diff --git a/src/@awesome-cordova-plugins/plugins/adjust/index.ts b/src/@awesome-cordova-plugins/plugins/adjust/index.ts index a10f2bb4a..4a9e8d3bb 100644 --- a/src/@awesome-cordova-plugins/plugins/adjust/index.ts +++ b/src/@awesome-cordova-plugins/plugins/adjust/index.ts @@ -5,7 +5,10 @@ export class AdjustEvent { private eventToken: string; private revenue: number; private currency: string; + private receipt: string; + private productId: string; private transactionId: string; + private purchaseToken: string; private callbackId: string; private callbackParameters: string[] = []; private partnerParameters: string[] = []; @@ -36,6 +39,18 @@ export class AdjustEvent { setCallbackId(callbackId: string) { this.callbackId = callbackId; } + + setReceipt(receipt: string) { + this.receipt = receipt; + } + + setProductId(productId: string) { + this.productId = productId; + } + + setPurchaseToken(purchaseToken: string) { + this.purchaseToken = purchaseToken; + } } export class AdjustConfig { @@ -65,9 +80,11 @@ export class AdjustConfig { private allowiAdInfoReading: boolean = null; // iOS only private allowIdfaReading: boolean = null; // iOS only private allowAdServicesInfoReading: boolean = null; // iOS only - private coppaCompliantEnabled: boolean = null; + private coppaCompliantEnabled: boolean = null; private playStoreKidsAppEnabled: boolean = null; // Android only private linkMeEnabled: boolean = null; // iOS only + private finalAndroidAttributionEnabled: boolean = null; // Android only + private attConsentWaitingInterval: number = null; // iOS only private attributionCallback: (attribution: AdjustAttribution) => void = null; private eventTrackingSucceededCallback: (event: AdjustEventSuccess) => void = null; @@ -76,6 +93,7 @@ export class AdjustConfig { private sessionTrackingFailedCallback: (session: AdjustSessionFailure) => void = null; private deferredDeeplinkCallback: (uri: string) => void = null; private conversionValueUpdatedCallback: (conversionValue: number) => void = null; + private skad4ConversionValueUpdatedCallback: (skad4Data: AdjustSkad4Data) => void = null; constructor(appToken: string, environment: AdjustEnvironment) { this.appToken = appToken; @@ -174,6 +192,14 @@ export class AdjustConfig { this.linkMeEnabled = linkMeEnabled; } + setFinalAndroidAttributionEnabled(finalAndroidAttributionEnabled: boolean) { + this.finalAndroidAttributionEnabled = finalAndroidAttributionEnabled; + } + + setAttConsentWaitingInterval(attConsentWaitingInterval: number) { + this.attConsentWaitingInterval = attConsentWaitingInterval; + } + setAttributionCallbackListener(attributionCallback: (attribution: AdjustAttribution) => void) { this.attributionCallback = attributionCallback; } @@ -204,6 +230,12 @@ export class AdjustConfig { this.conversionValueUpdatedCallback = conversionValueUpdatedCallback; } + setSkad4ConversionValueUpdatedCallbackListener( + skad4ConversionValueUpdatedCallback: (skad4Data: AdjustSkad4Data) => void + ) { + this.skad4ConversionValueUpdatedCallback = skad4ConversionValueUpdatedCallback; + } + private getAttributionCallback() { return this.attributionCallback; } @@ -232,6 +264,10 @@ export class AdjustConfig { return this.conversionValueUpdatedCallback; } + private getSkad4ConversionValueUpdatedCallback() { + return this.skad4ConversionValueUpdatedCallback; + } + private hasAttributionListener() { return this.attributionCallback !== null; } @@ -259,6 +295,10 @@ export class AdjustConfig { private hasConversionValueUpdatedCallbackListener() { return this.conversionValueUpdatedCallback !== null; } + + private hasSkad4ConversionValueUpdatedCallbackListener() { + return this.skad4ConversionValueUpdatedCallback !== null; + } } export class AdjustAppStoreSubscription { @@ -401,6 +441,28 @@ export class AdjustAdRevenue { } } +export class AdjustAppStorePurchase { + private receipt: string; + private productId: string; + private transactionId: string; + + constructor(receipt: string, productId: string, transactionId: string) { + this.receipt = receipt; + this.productId = productId; + this.transactionId = transactionId; + } +} + +export class AdjustPlayStorePurchase { + private productId: string; + private purchaseToken: string; + + constructor(productId: string, purchaseToken: string) { + this.productId = productId; + this.purchaseToken = purchaseToken; + } +} + export interface AdjustAttribution { trackerToken: string; trackerName: string; @@ -450,6 +512,18 @@ export interface AdjustEventFailure { jsonResponse: string; } +export interface AdjustSkad4Data { + fineValue: number; + coarseValue: string; + lockWindow: boolean; +} + +export interface AdjustPurchaseVerificationInfo { + verificationStatus: string; + code: number; + message: string; +} + export enum AdjustEnvironment { Sandbox = 'sandbox', Production = 'production', @@ -468,6 +542,7 @@ export enum AdjustLogLevel { export enum AdjustUrlStrategy { India = 'india', China = 'china', + Cn = 'cn', DataResidencyEU = 'data-residency-eu', DataResidencyTR = 'data-residency-tr', DataResidencyUS = 'data-residency-us', @@ -478,10 +553,10 @@ export enum AdjustAdRevenueSource { AdRevenueSourceMopub = 'mopub', AdRevenueSourceAdMob = 'admob_sdk', AdRevenueSourceIronSource = 'ironsource_sdk', - AdRevenueSourceAdMost = "admost_sdk", - AdRevenueSourceUnity = "unity_sdk", - AdRevenueSourceHeliumChartboost = "helium_chartboost_sdk", - AdRevenueSourcePublisher = "publisher_sdk", + AdRevenueSourceAdMost = 'admost_sdk', + AdRevenueSourceUnity = 'unity_sdk', + AdRevenueSourceHeliumChartboost = 'helium_chartboost_sdk', + AdRevenueSourcePublisher = 'publisher_sdk', } /** @@ -511,13 +586,17 @@ export enum AdjustAdRevenueSource { * AdjustSessionFailure * AdjustEventSuccess * AdjustEventFailure + * AdjustSkad4Data + * AdjustPurchaseVerificationInfo * @classes * AdjustEvent * AdjustConfig * AdjustAppStoreSubscription * AdjustPlayStoreSubscription * AdjustThirdPartySharing - * AdjustAdReenue + * AdjustAdRevenue + * AdjustAppStorePurchase + * AdjustPlayStorePurchase * @enums * AdjustEnvironment * AdjustLogLevel @@ -533,7 +612,6 @@ export enum AdjustAdRevenueSource { }) @Injectable() export class Adjust extends AwesomeCordovaNativePlugin { - /** * This method initializes Adjust SDK * @@ -652,7 +730,7 @@ export class Adjust extends AwesomeCordovaNativePlugin { gdprForgetMe(): void {} /** - * You can now notify Adjust when a user has exercised their right to stop sharing their data with partners for marketing purposes, but has allowed it to be shared for statistics purposes. + * You can now notify Adjust when a user has exercised their right to stop sharing their data with partners for marketing purposes, but has allowed it to be shared for statistics purposes. * Calling the following method will instruct the Adjust SDK to communicate the user's choice to disable data sharing to the Adjust backend */ @Cordova({ sync: true }) @@ -815,4 +893,20 @@ export class Adjust extends AwesomeCordovaNativePlugin { getLastDeeplink(): Promise { return; } -} \ No newline at end of file + + /** + * This method is used to verify the App Store purchase + * + * @param {AdjustAppStorePurchase} purchase Adjust App Store purchase object to be verified + */ + @Cordova() + verifyAppStorePurchase(purchase: AdjustAppStorePurchase): Promise {} + + /** + * This method is used to verify the Play Store purchase + * + * @param {AdjustPlayStorePurchase} purchase Adjust Play Store purchase object to be verified + */ + @Cordova() + verifyPlayStorePurchase(purchase: AdjustPlayStorePurchase): Promise {} +}