Compare commits

..
Author SHA1 Message Date
Daniel Sogl 98919da195 feat(appsflyer): add missing v6.18.1 SDK methods
Sync the wrapper with cordova-plugin-appsflyer-sdk@6.18.1 (www/appsflyer.js).
Adds startSdk, registerDeepLink, setCurrencyCode, getSdkVersion,
setSharingFilterForPartners/setSharingFilter/setSharingFilterForAllPartners,
validateAndLogInAppPurchase/V2, setUseReceiptValidationSandbox,
disableCollectASA, setDisableAdvertisingIdentifier, setOneLinkCustomDomains,
enableFacebookDeferredApplinks, setUserEmails, setPhoneNumber, setHost,
addPushNotificationDeepLinkPath, setResolveDeepLinkURLs, disableSKAD,
setCurrentDeviceLanguage, setAdditionalData, setPartnerData,
sendPushNotificationData, setDisableNetworkData, setConsentData,
enableTCFDataCollection, logAdRevenue, disableAppSetId and handleOpenUrl,
plus supporting AppsflyerConsent/AppsflyerPurchaseDetails/
AppsflyerAdRevenueData/AppsflyerMediationNetwork types.
2026-07-27 22:19:46 +02:00
2 changed files with 374 additions and 123 deletions
@@ -36,6 +36,16 @@ export interface AppsflyerOptions {
* time for the sdk to wait before launch - IOS 14 ONLY!
*/
waitForATTUserAuthorization?: number;
/**
* For iOS only, to test uninstall in Sandbox environment
*/
useUninstallSandbox?: boolean;
/**
* Prevents the SDK from sending the launch request after calling initSdk(...). When using this property, the app needs to manually trigger the startSdk() API to report the app launch. default=true
*/
shouldStartSdk?: boolean;
}
export interface AppsflyerEvent {
@@ -50,6 +60,87 @@ export interface AppsflyerInviteOptions {
};
}
export interface AppsflyerConsent {
/**
* Indicates whether GDPR regulations apply to the user. Also serves as a flag for compliance with relevant aspects of DMA regulations.
*/
isUserSubjectToGDPR: boolean | null;
/**
* Indicates whether the user has consented to use their data for advertising purposes.
*/
hasConsentForDataUsage: boolean | null;
/**
* Indicates whether the user has consented to use their data for personalized advertising.
*/
hasConsentForAdsPersonalization: boolean | null;
/**
* Indicates whether the user has provided consent for the storage of their advertising data.
*/
hasConsentForAdStorage: boolean | null;
}
export interface AppsflyerPurchaseDetails {
/**
* The purchase type: "subscription" or "one_time_purchase"
*/
purchaseType: string;
/**
* The purchase token from Google Play Store (Android) or transaction ID (iOS)
*/
purchaseToken: string;
/**
* The product identifier
*/
productId: string;
}
/**
* Mediation network values accepted by logAdRevenue's AppsflyerAdRevenueData.mediationNetwork field.
*/
export enum AppsflyerMediationNetwork {
IRONSOURCE = 'ironsource',
APPLOVIN_MAX = 'applovinmax',
GOOGLE_ADMOB = 'googleadmob',
FYBER = 'fyber',
APPODEAL = 'appodeal',
ADMOST = 'Admost',
TOPON = 'Topon',
TRADPLUS = 'Tradplus',
YANDEX = 'Yandex',
CHARTBOOST = 'chartboost',
UNITY = 'Unity',
TOPON_PTE = 'toponpte',
CUSTOM_MEDIATION = 'customMediation',
DIRECT_MONETIZATION_NETWORK = 'directMonetizationNetwork',
}
export interface AppsflyerAdRevenueData {
/**
* The monetization network name
*/
monetizationNetwork: string;
/**
* The mediation network used
*/
mediationNetwork: AppsflyerMediationNetwork;
/**
* ISO 4217 currency code
*/
currencyIso4217Code: string;
/**
* The ad revenue amount
*/
revenue: number;
}
/**
* @name Appsflyer
* @description
@@ -71,6 +162,9 @@ export interface AppsflyerInviteOptions {
* AppsflyerOptions
* AppsflyerEvent
* AppsflyerInviteOptions
* AppsflyerConsent
* AppsflyerPurchaseDetails
* AppsflyerAdRevenueData
*/
@Plugin({
pluginName: 'Appsflyer',
@@ -209,4 +303,276 @@ export class Appsflyer extends AwesomeCordovaNativePlugin {
*/
@Cordova({ sync: true })
logCrossPromotionAndOpenStore(appId: string, campaign: string, options: object): void {}
/**
* Starts the SDK. Must call initSdk first in order to make this work. Used together with the AppsflyerOptions.shouldStartSdk option.
*/
@Cordova({ sync: true })
startSdk(): void {}
/**
* Register Unified deep link listener. Must be called before initSdk() and it overrides registerOnAppOpenAttribution.
*
* @returns {Promise<any>}
*/
@Cordova()
registerDeepLink(): Promise<any> {
return;
}
/**
* Set the currency code used for in-app purchase events.
*
* @param {string} currencyId ISO 4217 Currency Codes, default 'USD'
*/
@Cordova({ sync: true })
setCurrencyCode(currencyId: string): void {}
/**
* Get the current SDK version
*
* @returns {Promise<any>}
*/
@Cordova()
getSdkVersion(): Promise<any> {
return;
}
/**
* @deprecated deprecated since 6.4.0. Use setSharingFilterForPartners instead
* Used by advertisers to exclude all networks/integrated partners from getting data
*/
@Cordova({ sync: true })
setSharingFilterForAllPartners(): void {}
/**
* @deprecated deprecated since 6.4.0. Use setSharingFilterForPartners instead
* Used by advertisers to exclude specified networks/integrated partners from getting data
*
* @param {string[]} networks Array of partners that need to be excluded
*/
@Cordova({ sync: true })
setSharingFilter(networks: string[]): void {}
/**
* Used by advertisers to exclude specified networks/integrated partners from getting data
*
* @param {string[]} networks Array of partners that need to be excluded
*/
@Cordova({ sync: true })
setSharingFilterForPartners(networks: string[]): void {}
/**
* @deprecated Will be removed in the future. Please use validateAndLogInAppPurchaseV2.
* Receipt validation is a secure mechanism whereby the payment platform (e.g. Apple or Google) validates that an in-app purchase indeed occurred as reported.
*
* @param {AppsflyerEvent} purchaseInfo In-App Purchase parameters
* @returns {Promise<any>}
*/
@Cordova()
validateAndLogInAppPurchase(purchaseInfo: AppsflyerEvent): Promise<any> {
return;
}
/**
* Receipt validation is a secure mechanism whereby the payment platform (e.g. Apple or Google) validates that an in-app purchase indeed occurred as reported. This method uses V2 API.
*
* @param {AppsflyerPurchaseDetails} purchaseDetails Purchase details object containing productId, purchaseToken and purchaseType
* @param {AppsflyerEvent} additionalParameters Additional parameters to include with the purchase event (optional)
* @returns {Promise<any>}
*/
@Cordova()
validateAndLogInAppPurchaseV2(
purchaseDetails: AppsflyerPurchaseDetails,
additionalParameters?: AppsflyerEvent
): Promise<any> {
return;
}
/**
* In app purchase receipt validation Apple environment (production or sandbox)
*
* @param {boolean} isSandbox true if In app purchase is done with sandbox
* @returns {Promise<any>}
*/
@Cordova()
setUseReceiptValidationSandbox(isSandbox: boolean): Promise<any> {
return;
}
/**
* (iOS only) AppsFlyer SDK dynamically loads the Apple iAd.framework. This framework is required to record and measure the performance of Apple Search Ads in your app. If you don't want AppsFlyer to dynamically load this framework, set this property to true.
*
* @param {boolean} collectASA If you don't want AppsFlyer to dynamically load iAd.framework, set this property to true
* @returns {Promise<any>}
*/
@Cordova()
disableCollectASA(collectASA: boolean): Promise<any> {
return;
}
/**
* Disable collection of Apple, Google, Amazon and Open advertising ids (IDFA, GAID, AAID, OAID).
*
* @param {boolean} disableAdvertisingIdentifier Disable collection of advertising ids
* @returns {Promise<any>}
*/
@Cordova()
setDisableAdvertisingIdentifier(disableAdvertisingIdentifier: boolean): Promise<any> {
return;
}
/**
* Set Onelink custom/branded domains. Use this API during the SDK Initialization to indicate branded domains.
*
* @param {string[]} domains String array of branded domains
* @returns {Promise<any>}
*/
@Cordova()
setOneLinkCustomDomains(domains: string[]): Promise<any> {
return;
}
/**
* Support deferred deep linking from Facebook Ads. Use this API before initSdk().
*
* @param {boolean} isEnabled enable support deferred deep linking from Facebook Ads
*/
@Cordova({ sync: true })
enableFacebookDeferredApplinks(isEnabled: boolean): void {}
/**
* Set user emails for FB Advanced Matching
*
* @param {string[]} emails String array of emails
* @returns {Promise<any>}
*/
@Cordova()
setUserEmails(emails: string[]): Promise<any> {
return;
}
/**
* Set phone number for FB Advanced Matching
*
* @param {string} phoneNumber String phone number
* @returns {Promise<any>}
*/
@Cordova()
setPhoneNumber(phoneNumber: string): Promise<any> {
return;
}
/**
* Set custom host prefix and host name
*
* @param {string} hostPrefix host prefix
* @param {string} hostName host name
*/
@Cordova({ sync: true })
setHost(hostPrefix: string, hostName: string): void {}
/**
* Provides app owners with a flexible interface for configuring how deep links are extracted from push notification payloads. Must be called before initSdk().
*
* @param {string[]} path strings array of the path
*/
@Cordova({ sync: true })
addPushNotificationDeepLinkPath(path: string[]): void {}
/**
* Use this API to get the OneLink from click domains that launch the app. Make sure to call this API before SDK initialization.
*
* @param {string[]} urls strings array of domains
*/
@Cordova({ sync: true })
setResolveDeepLinkURLs(urls: string[]): void {}
/**
* Enable or disable SKAD support. Set true if you want to disable it. Must be called before initSdk() and for iOS only.
*
* @param {boolean} isDisabled disable or enable SKAD support
*/
@Cordova({ sync: true })
disableSKAD(isDisabled: boolean): void {}
/**
* Set the language of the device. The data will be displayed in Raw Data Reports. Must be called before initSdk() and for iOS only.
*
* @param {string} language The device language
*/
@Cordova({ sync: true })
setCurrentDeviceLanguage(language: string): void {}
/**
* Allows you to add custom data to events sent from the SDK. Typically used to integrate on the SDK level with several external partner platforms.
*
* @param {AppsflyerEvent} additionalData custom data
*/
@Cordova({ sync: true })
setAdditionalData(additionalData: AppsflyerEvent): void {}
/**
* Allows sending custom data for partner integration purposes.
*
* @param {string} partnerId ID of the partner (usually suffixed with "_int")
* @param {AppsflyerEvent} data Customer data, depends on the integration configuration with the specific partner
*/
@Cordova({ sync: true })
setPartnerData(partnerId: string, data: AppsflyerEvent): void {}
/**
* Measure and get data from push-notification campaigns.
*
* @param {AppsflyerEvent} pushData JSON object contains the push data
*/
@Cordova({ sync: true })
sendPushNotificationData(pushData: AppsflyerEvent): void {}
/**
* Use to opt-out of collecting the network operator name (carrier) and sim operator name from the device.
*
* @param {boolean} disable Defaults to false
*/
@Cordova({ sync: true })
setDisableNetworkData(disable: boolean): void {}
/**
* Set consent fields manually (e.g. by prompting user and collecting results). Use this API to provide the consent data directly to the SDK when GDPR applies to the user and your app does not use a CMP compatible with TCF v2.2.
*
* @param {AppsflyerConsent} appsFlyerConsent Consent data
*/
@Cordova({ sync: true })
setConsentData(appsFlyerConsent: AppsflyerConsent): void {}
/**
* Instruct the SDK to collect the TCF data from the device.
*
* @param {boolean} enable enable/disable TCF data collection
*/
@Cordova({ sync: true })
enableTCFDataCollection(enable: boolean): void {}
/**
* Log ad revenue event.
*
* @param {AppsflyerAdRevenueData} adRevenueData the ad revenue data
* @param {AppsflyerEvent} additionalParameters additional params data (optional)
*/
@Cordova({ sync: true })
logAdRevenue(adRevenueData: AppsflyerAdRevenueData, additionalParameters?: AppsflyerEvent): void {}
/**
* (Android only) Disables App Set ID collection (enabled by default).
*/
@Cordova({ sync: true })
disableAppSetId(): void {}
/**
* (iOS) Log deep linking. Add a function 'handleOpenUrl' to your root and call this to track deeplinks with AppsFlyer attribution data.
*
* @param {string} url the opened url
*/
@Cordova({ sync: true })
handleOpenUrl(url: string): void {}
}
@@ -40,15 +40,7 @@ export class GeniusScan extends AwesomeCordovaNativePlugin {
}
@Cordova()
scanWithConfiguration(configuration?: ScanConfiguration): Promise<SuccessScanResult> {
return;
}
/**
* Starts the barcode scanner module.
*/
@Cordova()
scanBarcodesWithConfiguration(configuration?: BarcodeConfiguration): Promise<BarcodeResult> {
scanWithConfiguration(configuration: ScanConfiguration): Promise<SuccessScanResult> {
return;
}
@@ -82,31 +74,15 @@ interface ScanConfiguration {
multiPageFormat?: 'pdf' | 'tiff' | 'none';
/**
* The filter that will be applied by default to enhance scans, or 'none' if no
* enhancement should be performed by default. Possible values include 'automatic',
* 'automaticColor', 'automaticBlackAndWhite', 'automaticMonochrome', 'photo',
* 'softBlackAndWhite', 'softColor', 'strongMonochrome', 'strongBlackAndWhite',
* 'strongColor', 'darkBackground' and 'none' (defaults to 'automatic').
* (by default, the filter is chosen automatically)
*/
defaultFilter?: string;
/**
* an array of filters that the user can select when they tap on the edit filter button.
* Defaults to ['none', 'automatic', 'automaticMonochrome', 'automaticBlackAndWhite', 'automaticColor', 'photo'].
*/
availableFilters?: string[];
defaultFilter?: 'none' | 'blackAndWhite' | 'monochrome' | 'color' | 'photo';
/**
* defaults to fit
*/
pdfPageSize?: 'fit' | 'a4' | 'letter';
/**
* Optional password used to protect generated PDF documents. Empty passwords are
* treated as no password. Only applies when multiPageFormat is 'pdf'.
*/
pdfPassword?: string;
/**
* max dimension in pixels when images are scaled before PDF generation,
* for example 2000 to fit both height and width within 2000px.
@@ -127,42 +103,12 @@ interface ScanConfiguration {
*/
jpegQuality?: number;
/**
* Whether to skip showing the post-processing screen. Only recommended when
* scanning structured data; generally the user should visually confirm each scan.
*/
skipPostProcessingScreen?: boolean;
/**
* an array with the desired actions to display during the post processing screen
* (defaults to all actions).
*/
postProcessingActions?: ('rotate' | 'editFilter' | 'correctDistortion')[];
/**
* whether a curvature correction should be applied by default (defaults to 'disabled').
*/
defaultCurvatureCorrection?: 'enabled' | 'disabled';
/**
* automatically show crop validation after capture. 'never', 'always', or an object
* with a confidence threshold below which validation should be shown.
*/
showCropValidation?:
'never' | 'always' | { whenConfidenceBelowOrEqual: 'lowest' | 'low' | 'medium' | 'high' | 'highest' };
/**
* 'automatic' to rotate scan automatically after capture or 'original' to keep the
* original scan orientation (defaults to 'automatic').
*/
defaultScanOrientation?: 'automatic' | 'original';
/**
* whether the button allowing the user to pick an image on the Camera screen
* should be hidden (defaults to false).
*/
photoLibraryButtonHidden?: boolean;
/**
* (default to false)
*/
@@ -214,68 +160,13 @@ interface ScanConfiguration {
*/
outputFormats?: ('rawText' | 'hOCR' | 'textLayerInPDF')[];
};
/**
* an array of the structured data you want to extract. E.g.: ['receipt', 'businessCard'].
* Possible values are 'receipt', 'barcode', 'bankDetails' (iOS only), 'businessCard' (iOS only).
*/
structuredData?: string[];
/**
* an array of the barcode types to extract, e.g. ['qr', 'code39']. Possible values are
* 'aztec', 'code39', 'code93', 'code128', 'dataMatrix', 'ean8', 'ean13', 'itf', 'pdf417',
* 'qr', 'upca' (Android only), 'upce', 'codabar' (iOS 15+ only), 'gs1DataBar' (iOS 15+ only),
* 'microPDF417' (iOS 15+ only), 'microQR' (iOS 15+ only), 'msiPlessey' (iOS 17+ only).
*/
structuredDataBarcodeTypes?: string[];
/**
* the required readability level below which a warning will be displayed to the user
* (defaults to 'lowest', which means the warning will never be displayed).
*/
requiredReadabilityLevel?: 'lowest' | 'low' | 'medium' | 'high' | 'highest';
/**
* whether the final review screen should be displayed before submission (default to false).
*/
showFinalReview?: boolean;
}
interface BarcodeConfiguration {
/**
* whether the barcode scanner should keep scanning and accumulating results after
* detecting a first barcode.
*/
isBatchModeEnabled?: boolean;
/**
* an array of the barcode types to detect. Defaults to all supported types.
*/
supportedCodeTypes?: string[];
}
interface BarcodeResult {
/**
* an array of the detected barcodes.
*/
barcodes: {
/**
* the decoded value of the barcode.
*/
value: string;
/**
* the type of the barcode, e.g. 'qr', 'code128'.
*/
type: string;
}[];
}
interface SuccessScanResult {
/**
* a document containing all the scanned pages (example: "file://.pdf")
*/
multiPageDocumentUrl?: string;
multiPageDocumentUrl: string;
/**
* an array of scan objects.
@@ -292,9 +183,9 @@ interface SuccessScanResult {
enhancedUrl: string;
/**
* the result of text recognition for this scan, present when ocrConfiguration was set.
* the result of text recognition for this scan
*/
ocrResult?: {
ocrResult: {
/**
* the raw text that was recognized
*/
@@ -303,14 +194,8 @@ interface SuccessScanResult {
/**
* the recognized text in hOCR format (with position, style…)
*/
hocrTextLayout?: string;
hocrTextLayout: string;
};
/**
* the result of the structured data extraction, present when structuredData was set.
* A subdictionary is present for each type of structured data detected.
*/
structuredData?: any;
}[];
}
@@ -324,7 +209,7 @@ interface GenerateDocumentPages {
/**
* the text layout in hOCR format
*/
hocrTextLayout?: string;
hocrTextLayout: string;
}[];
}