mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-19 08:32:52 +08:00
feat(adjust): update wrapper for Adjust Cordova SDK v4.29.0 (#3720)
This commit is contained in:
parent
6f14bce6ce
commit
68af9eb525
@ -60,6 +60,7 @@ export class AdjustConfig {
|
|||||||
private info4: number = null;
|
private info4: number = null;
|
||||||
private processName: string = null; // Android only
|
private processName: string = null; // Android only
|
||||||
private preinstallTrackingEnabled: boolean = null; // Android only
|
private preinstallTrackingEnabled: boolean = null; // Android only
|
||||||
|
private preinstallFilePath: string = null; // Android only
|
||||||
private allowiAdInfoReading: boolean = null; // iOS only
|
private allowiAdInfoReading: boolean = null; // iOS only
|
||||||
private allowIdfaReading: boolean = null; // iOS only
|
private allowIdfaReading: boolean = null; // iOS only
|
||||||
private allowAdServicesInfoReading: boolean = null; // iOS only
|
private allowAdServicesInfoReading: boolean = null; // iOS only
|
||||||
@ -70,6 +71,7 @@ export class AdjustConfig {
|
|||||||
private sessionTrackingSucceededCallback: (session: AdjustSessionSuccess) => void = null;
|
private sessionTrackingSucceededCallback: (session: AdjustSessionSuccess) => void = null;
|
||||||
private sessionTrackingFailedCallback: (session: AdjustSessionFailure) => void = null;
|
private sessionTrackingFailedCallback: (session: AdjustSessionFailure) => void = null;
|
||||||
private deferredDeeplinkCallback: (uri: string) => void = null;
|
private deferredDeeplinkCallback: (uri: string) => void = null;
|
||||||
|
private conversionValueUpdatedCallback: (conversionValue: number) => void = null;
|
||||||
|
|
||||||
constructor(appToken: string, environment: AdjustEnvironment) {
|
constructor(appToken: string, environment: AdjustEnvironment) {
|
||||||
this.appToken = appToken;
|
this.appToken = appToken;
|
||||||
@ -136,6 +138,10 @@ export class AdjustConfig {
|
|||||||
this.preinstallTrackingEnabled = preinstallTrackingEnabled;
|
this.preinstallTrackingEnabled = preinstallTrackingEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setPreinstallFilePath(preinstallFilePath: string) {
|
||||||
|
this.preinstallFilePath = preinstallFilePath;
|
||||||
|
}
|
||||||
|
|
||||||
setAllowiAdInfoReading(allowiAdInfoReading: boolean) {
|
setAllowiAdInfoReading(allowiAdInfoReading: boolean) {
|
||||||
this.allowiAdInfoReading = allowiAdInfoReading;
|
this.allowiAdInfoReading = allowiAdInfoReading;
|
||||||
}
|
}
|
||||||
@ -160,9 +166,7 @@ export class AdjustConfig {
|
|||||||
this.eventTrackingFailedCallback = eventTrackingFailedCallback;
|
this.eventTrackingFailedCallback = eventTrackingFailedCallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
setSessionTrackingSucceededCallbackListener(
|
setSessionTrackingSucceededCallbackListener(sessionTrackingSucceededCallback: (session: AdjustSessionSuccess) => void) {
|
||||||
sessionTrackingSucceededCallback: (session: AdjustSessionSuccess) => void
|
|
||||||
) {
|
|
||||||
this.sessionTrackingSucceededCallback = sessionTrackingSucceededCallback;
|
this.sessionTrackingSucceededCallback = sessionTrackingSucceededCallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,6 +178,10 @@ export class AdjustConfig {
|
|||||||
this.deferredDeeplinkCallback = deferredDeeplinkCallback;
|
this.deferredDeeplinkCallback = deferredDeeplinkCallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setConversionValueUpdatedCallbackListener(conversionValueUpdatedCallback: (conversionValue: number) => void) {
|
||||||
|
this.conversionValueUpdatedCallback = conversionValueUpdatedCallback;
|
||||||
|
}
|
||||||
|
|
||||||
private getAttributionCallback() {
|
private getAttributionCallback() {
|
||||||
return this.attributionCallback;
|
return this.attributionCallback;
|
||||||
}
|
}
|
||||||
@ -198,6 +206,10 @@ export class AdjustConfig {
|
|||||||
return this.deferredDeeplinkCallback;
|
return this.deferredDeeplinkCallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getConversionValueUpdatedCallback() {
|
||||||
|
return this.conversionValueUpdatedCallback;
|
||||||
|
}
|
||||||
|
|
||||||
private hasAttributionListener() {
|
private hasAttributionListener() {
|
||||||
return this.attributionCallback !== null;
|
return this.attributionCallback !== null;
|
||||||
}
|
}
|
||||||
@ -270,7 +282,14 @@ export class AdjustPlayStoreSubscription {
|
|||||||
private callbackParameters: string[] = [];
|
private callbackParameters: string[] = [];
|
||||||
private partnerParameters: string[] = [];
|
private partnerParameters: string[] = [];
|
||||||
|
|
||||||
constructor(price: string, currency: string, sku: string, orderId: string, signature: string, purchaseToken: string) {
|
constructor(
|
||||||
|
price: string,
|
||||||
|
currency: string,
|
||||||
|
sku: string,
|
||||||
|
orderId: string,
|
||||||
|
signature: string,
|
||||||
|
purchaseToken: string
|
||||||
|
) {
|
||||||
this.price = price;
|
this.price = price;
|
||||||
this.currency = currency;
|
this.currency = currency;
|
||||||
this.sku = sku;
|
this.sku = sku;
|
||||||
@ -309,6 +328,53 @@ export class AdjustThirdPartySharing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class AdjustAdRevenue {
|
||||||
|
private source: string;
|
||||||
|
private revenue: number;
|
||||||
|
private currency: string;
|
||||||
|
private adImpressionsCount: number;
|
||||||
|
private adRevenueNetwork: string;
|
||||||
|
private adRevenueUnit: string;
|
||||||
|
private adRevenuePlacement: string;
|
||||||
|
private callbackParameters: string[] = [];
|
||||||
|
private partnerParameters: string[] = [];
|
||||||
|
|
||||||
|
constructor(source: string) {
|
||||||
|
this.source = source;
|
||||||
|
}
|
||||||
|
|
||||||
|
setRevenue(revenue: number, currency: string): void {
|
||||||
|
this.revenue = revenue;
|
||||||
|
this.currency = currency;
|
||||||
|
}
|
||||||
|
|
||||||
|
addCallbackParameter(key: string, value: string): void {
|
||||||
|
this.callbackParameters.push(key);
|
||||||
|
this.callbackParameters.push(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
addPartnerParameter(key: string, value: string): void {
|
||||||
|
this.partnerParameters.push(key);
|
||||||
|
this.partnerParameters.push(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
setAdImpressionsCount(adImpressionsCount: number) {
|
||||||
|
this.adImpressionsCount = adImpressionsCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
setAdRevenueNetwork(adRevenueNetwork: string) {
|
||||||
|
this.adRevenueNetwork = adRevenueNetwork;
|
||||||
|
}
|
||||||
|
|
||||||
|
setAdRevenueUnit(adRevenueUnit: string) {
|
||||||
|
this.adRevenueUnit = adRevenueUnit;
|
||||||
|
}
|
||||||
|
|
||||||
|
setAdRevenuePlacement(adRevenuePlacement: string) {
|
||||||
|
this.adRevenuePlacement = adRevenuePlacement;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export interface AdjustAttribution {
|
export interface AdjustAttribution {
|
||||||
trackerToken: string;
|
trackerToken: string;
|
||||||
trackerName: string;
|
trackerName: string;
|
||||||
@ -359,7 +425,7 @@ export interface AdjustEventFailure {
|
|||||||
|
|
||||||
export enum AdjustEnvironment {
|
export enum AdjustEnvironment {
|
||||||
Sandbox = 'sandbox',
|
Sandbox = 'sandbox',
|
||||||
Production = 'production',
|
Production = 'production'
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum AdjustLogLevel {
|
export enum AdjustLogLevel {
|
||||||
@ -369,34 +435,22 @@ export enum AdjustLogLevel {
|
|||||||
Warn = 'WARN',
|
Warn = 'WARN',
|
||||||
Error = 'ERROR',
|
Error = 'ERROR',
|
||||||
Assert = 'ASSERT',
|
Assert = 'ASSERT',
|
||||||
Suppress = 'SUPPRESS',
|
Suppress = 'SUPPRESS'
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum AdjustUrlStrategy {
|
export enum AdjustUrlStrategy {
|
||||||
India = 'India',
|
India = 'india',
|
||||||
China = 'China',
|
China = 'china',
|
||||||
|
DataResidencyEU = 'data-residency-eu',
|
||||||
|
DataResidencyTR = 'data-residency-tr',
|
||||||
|
DataResidencyUS = 'data-residency-us'
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum AdjustAdRevenueSource {
|
export enum AdjustAdRevenueSource {
|
||||||
|
AdRevenueSourceAppLovinMAX = 'applovin_max_sdk',
|
||||||
AdRevenueSourceMopub = 'mopub',
|
AdRevenueSourceMopub = 'mopub',
|
||||||
AdRevenueSourceAdmob = 'admob',
|
AdRevenueSourceAdMob = 'admob_sdk',
|
||||||
AdRevenueSourceFbNativeAd = 'facebook_native_ad',
|
AdRevenueSourceIronsource = 'ironsource_sdk',
|
||||||
AdRevenueSourceFbAudienceNetwork = 'facebook_audience_network',
|
|
||||||
AdRevenueSourceIronsource = 'ironsource',
|
|
||||||
AdRevenueSourceFyber = 'fyber',
|
|
||||||
AdRevenueSourceAerserv = 'aerserv',
|
|
||||||
AdRevenueSourceAppodeal = 'appodeal',
|
|
||||||
AdRevenueSourceAdincube = 'adincube',
|
|
||||||
AdRevenueSourceFusePowered = 'fusepowered',
|
|
||||||
AdRevenueSourceAddapptr = 'addapptr',
|
|
||||||
AdRevenueSourceMillennialMediation = 'millennial_mediation',
|
|
||||||
AdRevenueSourceFlurry = 'flurry',
|
|
||||||
AdRevenueSourceAdmost = 'admost',
|
|
||||||
AdRevenueSourceDeltadna = 'deltadna',
|
|
||||||
AdRevenueSourceUpsight = 'upsight',
|
|
||||||
AdRevenueSourceUnityAds = 'unityads',
|
|
||||||
AdRevenueSourceAdtoapp = 'adtoapp',
|
|
||||||
AdRevenueSourceTapdaq = 'tapdaq',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -408,7 +462,7 @@ export enum AdjustAdRevenueSource {
|
|||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import { Adjust, AdjustConfig, AdjustEnvironment } from '@ionic-native/adjust';
|
* import { Adjust, AdjustConfig, AdjustEnvironment } from '@ionic-native/adjust/ngx';
|
||||||
*
|
*
|
||||||
* constructor(private adjust: Adjust) { }
|
* constructor(private adjust: Adjust) { }
|
||||||
*
|
*
|
||||||
@ -432,6 +486,7 @@ export enum AdjustAdRevenueSource {
|
|||||||
* AdjustAppStoreSubscription
|
* AdjustAppStoreSubscription
|
||||||
* AdjustPlayStoreSubscription
|
* AdjustPlayStoreSubscription
|
||||||
* AdjustThirdPartySharing
|
* AdjustThirdPartySharing
|
||||||
|
* AdjustAdReenue
|
||||||
* @enums
|
* @enums
|
||||||
* AdjustEnvironment
|
* AdjustEnvironment
|
||||||
* AdjustLogLevel
|
* AdjustLogLevel
|
||||||
@ -443,10 +498,11 @@ export enum AdjustAdRevenueSource {
|
|||||||
plugin: 'com.adjust.sdk',
|
plugin: 'com.adjust.sdk',
|
||||||
pluginRef: 'Adjust',
|
pluginRef: 'Adjust',
|
||||||
repo: 'https://github.com/adjust/cordova_sdk',
|
repo: 'https://github.com/adjust/cordova_sdk',
|
||||||
platforms: ['Android', 'iOS'],
|
platforms: ['Android', 'iOS']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Adjust extends IonicNativePlugin {
|
export class Adjust extends IonicNativePlugin {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method initializes Adjust SDK
|
* This method initializes Adjust SDK
|
||||||
* @param {AdjustConig} config Adjust config object used as starting options
|
* @param {AdjustConig} config Adjust config object used as starting options
|
||||||
@ -487,8 +543,17 @@ export class Adjust extends IonicNativePlugin {
|
|||||||
* @param {AdjustAdRevenueSource} source Ad revenue source
|
* @param {AdjustAdRevenueSource} source Ad revenue source
|
||||||
* @param {string} payload Ad revenue JSON string payload
|
* @param {string} payload Ad revenue JSON string payload
|
||||||
*/
|
*/
|
||||||
@Cordova({ sync: true })
|
trackAdRevenue(source: AdjustAdRevenueSource, payload: string): void
|
||||||
trackAdRevenue(source: AdjustAdRevenueSource, payload: string): void {}
|
|
||||||
|
/**
|
||||||
|
* This method tracks ad revenue data
|
||||||
|
* @param {AdjustAdRevenue} adRevenue Adjust ad revenue object
|
||||||
|
*/
|
||||||
|
trackAdRevenue(adRevenue: AdjustAdRevenue): void
|
||||||
|
|
||||||
|
// And typescript hides this, so the client will be able call only methods above
|
||||||
|
@Cordova({sync: true})
|
||||||
|
trackAdRevenue(sourceOrAdRevenue: any, payload?: any): void {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method tracks measurement consent choice
|
* This method tracks measurement consent choice
|
||||||
@ -531,9 +596,7 @@ export class Adjust extends IonicNativePlugin {
|
|||||||
* @returns {Promise<boolean>}
|
* @returns {Promise<boolean>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
isEnabled(): Promise<boolean> {
|
isEnabled(): Promise<boolean> { return; }
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In accordance with article 17 of the EU's General Data Protection Regulation (GDPR), you can notify Adjust when a user has exercised their right to be forgotten.
|
* In accordance with article 17 of the EU's General Data Protection Regulation (GDPR), you can notify Adjust when a user has exercised their right to be forgotten.
|
||||||
@ -543,7 +606,7 @@ export class Adjust extends IonicNativePlugin {
|
|||||||
gdprForgetMe(): void {}
|
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
|
* 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 })
|
@Cordova({ sync: true })
|
||||||
@ -554,27 +617,21 @@ export class Adjust extends IonicNativePlugin {
|
|||||||
* @return {Promise<string>} Returns a promise with google AdId value
|
* @return {Promise<string>} Returns a promise with google AdId value
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
getGoogleAdId(): Promise<string> {
|
getGoogleAdId(): Promise<string> { return; }
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If you need to obtain the Amazon Advertising ID, you can make a call to this function.
|
* If you need to obtain the Amazon Advertising ID, you can make a call to this function.
|
||||||
* @return {Promise<string>} Returns a promise with anazib adv. ID
|
* @return {Promise<string>} Returns a promise with anazib adv. ID
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
getAmazonAdId(): Promise<string> {
|
getAmazonAdId(): Promise<string> { return; }
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To obtain the IDFA, call this function
|
* To obtain the IDFA, call this function
|
||||||
* @return {Promise<string>} Returns a promise with IDFA string value
|
* @return {Promise<string>} Returns a promise with IDFA string value
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
getIdfa(): Promise<string> {
|
getIdfa(): Promise<string> { return; }
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For every device with your app installed on it, the Adjust backend generates a unique Adjust device identifier (adid).
|
* For every device with your app installed on it, the Adjust backend generates a unique Adjust device identifier (adid).
|
||||||
@ -582,27 +639,21 @@ export class Adjust extends IonicNativePlugin {
|
|||||||
* @return {Promise<string>} Returns a promise with adid value
|
* @return {Promise<string>} Returns a promise with adid value
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
getAdid(): Promise<string> {
|
getAdid(): Promise<string> { return; }
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If you want to access information about a user's current attribution whenever you need it, you can make a call to this function
|
* If you want to access information about a user's current attribution whenever you need it, you can make a call to this function
|
||||||
* @return {Promise<AdjustAttribution>} Returns a promise with AdjustAttribution object
|
* @return {Promise<AdjustAttribution>} Returns a promise with AdjustAttribution object
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
getAttribution(): Promise<AdjustAttribution> {
|
getAttribution(): Promise<AdjustAttribution> { return; }
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the information about version of the SDK used
|
* Get the information about version of the SDK used
|
||||||
* @return {Promise<string>} Returns a promise with sdk version information
|
* @return {Promise<string>} Returns a promise with sdk version information
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
getSdkVersion(): Promise<string> {
|
getSdkVersion(): Promise<string> { return; }
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method used to add session callback parameters
|
* Method used to add session callback parameters
|
||||||
@ -658,9 +709,7 @@ export class Adjust extends IonicNativePlugin {
|
|||||||
* @return {Promise<number>} Returns a promise with user's consent value
|
* @return {Promise<number>} Returns a promise with user's consent value
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
requestTrackingAuthorizationWithCompletionHandler(): Promise<number> {
|
requestTrackingAuthorizationWithCompletionHandler(): Promise<number> { return; }
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* You can update SKAdNetwork conversion value with calling this method
|
* You can update SKAdNetwork conversion value with calling this method
|
||||||
@ -674,7 +723,5 @@ export class Adjust extends IonicNativePlugin {
|
|||||||
* @return {Promise<number>} Returns a promise with app tracking authorization status
|
* @return {Promise<number>} Returns a promise with app tracking authorization status
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
getAppTrackingAuthorizationStatus(): Promise<number> {
|
getAppTrackingAuthorizationStatus(): Promise<number> { return; }
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user