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 369 additions and 74 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 {}
}
@@ -30,9 +30,9 @@ export interface CameraPreviewOptions {
/** Preview box drag across the screen, default 'false' */
previewDrag?: boolean;
/** Capture images to a file and return back the file path instead of returning base64 encoded data. Defaults to false */
storeToFile?: boolean;
/** Capture images to a file and return back the file path instead of returning base64 encoded data. */
storeToFile: boolean;
/** Preview box to the back of the webview (true => back, false => front) , default false */
toBack?: boolean;
@@ -166,19 +166,6 @@ export class CameraPreview extends AwesomeCordovaNativePlugin {
CUSTOM: 'custom',
};
WHITE_BALANCE_MODE = {
LOCK: 'lock',
AUTO: 'auto',
CONTINUOUS: 'continuous',
INCANDESCENT: 'incandescent',
CLOUDY_DAYLIGHT: 'cloudy-daylight',
DAYLIGHT: 'daylight',
FLUORESCENT: 'fluorescent',
SHADE: 'shade',
TWILIGHT: 'twilight',
WARM_FLUORESCENT: 'warm-fluorescent',
};
FLASH_MODE = {
OFF: 'off',
ON: 'on',
@@ -310,16 +297,6 @@ export class CameraPreview extends AwesomeCordovaNativePlugin {
return;
}
/**
* Get color effects supported by the camera device currently started. Android only.
*
* @returns {Promise<any>}
*/
@Cordova()
getSupportedColorEffects(): Promise<any> {
return;
}
/**
*
* Set camera color effect.
@@ -530,40 +507,6 @@ export class CameraPreview extends AwesomeCordovaNativePlugin {
return;
}
/**
* Get white balance modes supported by the camera device currently started.
*
* @returns {Promise<any>}
*/
@Cordova()
getSupportedWhiteBalanceModes(): Promise<any> {
return;
}
/**
* Get the current white balance mode of the camera device currently started.
*
* @returns {Promise<any>}
*/
@Cordova()
getWhiteBalanceMode(): Promise<any> {
return;
}
/**
* Set the white balance mode for the camera device currently started.
*
* @param {string} [whiteBalanceMode] 'lock', 'auto', 'continuous', 'incandescent', 'cloudy-daylight', 'daylight', 'fluorescent', 'shade', 'twilight' or 'warm-fluorescent'
* @returns {Promise<any>}
*/
@Cordova({
successIndex: 1,
errorIndex: 2,
})
setWhiteBalanceMode(whiteBalanceMode?: string): Promise<any> {
return;
}
/**
* Set specific focus point. Note, this assumes the camera is full-screen.
*
@@ -605,18 +548,4 @@ export class CameraPreview extends AwesomeCordovaNativePlugin {
getCameraCharacteristics(): Promise<any> {
return;
}
/**
* Convert a local file (e.g. a `file://` path returned by takePicture with storeToFile) into a Blob.
*
* @param {string} path the local url to convert
* @returns {Promise<any>}
*/
@Cordova({
successIndex: 1,
errorIndex: 2,
})
getBlob(path: string): Promise<any> {
return;
}
}