mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-05-08 03:19:22 +08:00
feat(adjust): updating to match official typings (#3523)
This commit is contained in:
parent
99e6a5398f
commit
5a77eabf76
@ -45,6 +45,8 @@ export class AdjustConfig {
|
|||||||
private delayStart = 0.0;
|
private delayStart = 0.0;
|
||||||
private logLevel: AdjustLogLevel = null;
|
private logLevel: AdjustLogLevel = null;
|
||||||
private defaultTracker: string = null;
|
private defaultTracker: string = null;
|
||||||
|
private urlStrategy: string = null;
|
||||||
|
private externalDeviceId: string = null;
|
||||||
private sendInBackground: boolean = null;
|
private sendInBackground: boolean = null;
|
||||||
private shouldLaunchDeeplink: boolean = null;
|
private shouldLaunchDeeplink: boolean = null;
|
||||||
private eventBufferingEnabled: boolean = null;
|
private eventBufferingEnabled: boolean = null;
|
||||||
@ -56,6 +58,8 @@ export class AdjustConfig {
|
|||||||
private info3: number = null;
|
private info3: number = null;
|
||||||
private info4: number = null;
|
private info4: number = null;
|
||||||
private processName: string = null; // Android only
|
private processName: string = null; // Android only
|
||||||
|
private allowiAdInfoReading: boolean = null; // iOS only
|
||||||
|
private allowIdfaReading: boolean = null; // iOS only
|
||||||
|
|
||||||
private attributionCallback: (attribution: AdjustAttribution) => void = null;
|
private attributionCallback: (attribution: AdjustAttribution) => void = null;
|
||||||
private eventTrackingSucceededCallback: (event: AdjustEventSuccess) => void = null;
|
private eventTrackingSucceededCallback: (event: AdjustEventSuccess) => void = null;
|
||||||
@ -89,6 +93,10 @@ export class AdjustConfig {
|
|||||||
this.defaultTracker = defaultTracker;
|
this.defaultTracker = defaultTracker;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setExternalDeviceId(externalDeviceId: string) {
|
||||||
|
this.externalDeviceId = externalDeviceId;
|
||||||
|
}
|
||||||
|
|
||||||
setSendInBackground(sendInBackground: boolean) {
|
setSendInBackground(sendInBackground: boolean) {
|
||||||
this.sendInBackground = sendInBackground;
|
this.sendInBackground = sendInBackground;
|
||||||
}
|
}
|
||||||
@ -113,6 +121,14 @@ export class AdjustConfig {
|
|||||||
this.processName = processName;
|
this.processName = processName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setAllowiAdInfoReading(allowiAdInfoReading: boolean) {
|
||||||
|
this.allowiAdInfoReading = allowiAdInfoReading;
|
||||||
|
}
|
||||||
|
|
||||||
|
setAllowIdfaReading(allowIdfaReading: boolean) {
|
||||||
|
this.allowIdfaReading = allowIdfaReading;
|
||||||
|
}
|
||||||
|
|
||||||
setAttributionCallbackListener(attributionCallback: (attribution: AdjustAttribution) => void) {
|
setAttributionCallbackListener(attributionCallback: (attribution: AdjustAttribution) => void) {
|
||||||
this.attributionCallback = attributionCallback;
|
this.attributionCallback = attributionCallback;
|
||||||
}
|
}
|
||||||
@ -188,6 +204,77 @@ export class AdjustConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class AdjustAppStoreSubscription {
|
||||||
|
private price: string;
|
||||||
|
private currency: string;
|
||||||
|
private transactionId: string;
|
||||||
|
private receipt: string;
|
||||||
|
private transactionDate: string;
|
||||||
|
private salesRegion: string;
|
||||||
|
private callbackParameters: string[] = [];
|
||||||
|
private partnerParameters: string[] = [];
|
||||||
|
|
||||||
|
constructor(price: string, currency: string, transactionId: string, receipt: string) {
|
||||||
|
this.price = price;
|
||||||
|
this.currency = currency;
|
||||||
|
this.transactionId = transactionId;
|
||||||
|
this.receipt = receipt;
|
||||||
|
}
|
||||||
|
|
||||||
|
setTransactionDate(transactionDate: string): void {
|
||||||
|
this.transactionDate = transactionDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
setSalesRegion(salesRegion: string): void {
|
||||||
|
this.salesRegion = salesRegion;
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class AdjustPlayStoreSubscription {
|
||||||
|
private price: string;
|
||||||
|
private currency: string;
|
||||||
|
private sku: string;
|
||||||
|
private orderId: string;
|
||||||
|
private signature: string;
|
||||||
|
private purchaseToken: string;
|
||||||
|
private purchaseTime: string;
|
||||||
|
private callbackParameters: string[] = [];
|
||||||
|
private partnerParameters: string[] = [];
|
||||||
|
|
||||||
|
constructor(price: string, currency: string, sku: string, orderId: string, signature: string, purchaseToken: string) {
|
||||||
|
this.price = price;
|
||||||
|
this.currency = currency;
|
||||||
|
this.sku = sku;
|
||||||
|
this.orderId = orderId;
|
||||||
|
this.signature = signature;
|
||||||
|
this.purchaseToken = purchaseToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
setPurchaseTime(purchaseTime: string): void {
|
||||||
|
this.purchaseTime = purchaseTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export interface AdjustAttribution {
|
export interface AdjustAttribution {
|
||||||
trackerToken: string;
|
trackerToken: string;
|
||||||
trackerName: string;
|
trackerName: string;
|
||||||
@ -257,7 +344,7 @@ export enum AdjustLogLevel {
|
|||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import { Adjust, AdjustConfig, AdjustEnvironment } from '@ionic-native/adjust/ngx';
|
* import { Adjust, AdjustConfig, AdjustEnvironment } from '@ionic-native/adjust';
|
||||||
*
|
*
|
||||||
* constructor(private adjust: Adjust) { }
|
* constructor(private adjust: Adjust) { }
|
||||||
*
|
*
|
||||||
@ -278,6 +365,8 @@ export enum AdjustLogLevel {
|
|||||||
* @classes
|
* @classes
|
||||||
* AdjustEvent
|
* AdjustEvent
|
||||||
* AdjustConfig
|
* AdjustConfig
|
||||||
|
* AdjustAppStoreSubscription
|
||||||
|
* AdjustPlayStoreSubscription
|
||||||
* @enums
|
* @enums
|
||||||
* AdjustEnvironment
|
* AdjustEnvironment
|
||||||
* AdjustLogLevel
|
* AdjustLogLevel
|
||||||
@ -305,6 +394,20 @@ export class Adjust extends IonicNativePlugin {
|
|||||||
@Cordova({ sync: true })
|
@Cordova({ sync: true })
|
||||||
trackEvent(event: AdjustEvent): void {}
|
trackEvent(event: AdjustEvent): void {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method tracks App Store subscription
|
||||||
|
* @param {AdjustAppStoreSubscription} subscription Adjust App Store subscription object to be tracked
|
||||||
|
*/
|
||||||
|
@Cordova({ sync: true })
|
||||||
|
trackAppStoreSubscription(subscription: AdjustAppStoreSubscription): void {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method tracks Play Store subscription
|
||||||
|
* @param {AdjustPlayStoreSubscription} subscription Adjust Play Store subscription object to be tracked
|
||||||
|
*/
|
||||||
|
@Cordova({ sync: true })
|
||||||
|
trackPlayStoreSubscription(subscription: AdjustPlayStoreSubscription): void {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method sets offline mode on or off
|
* This method sets offline mode on or off
|
||||||
* @param {boolean} enabled set to true for offline mode on
|
* @param {boolean} enabled set to true for offline mode on
|
||||||
@ -350,6 +453,13 @@ export class Adjust extends IonicNativePlugin {
|
|||||||
@Cordova({ sync: true })
|
@Cordova({ sync: true })
|
||||||
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.
|
||||||
|
* 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 })
|
||||||
|
disableThirdPartySharing(): void {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function used to get Google AdId
|
* Function used to get Google AdId
|
||||||
* @return {Promise<string>} Returns a promise with google AdId value
|
* @return {Promise<string>} Returns a promise with google AdId value
|
||||||
@ -452,4 +562,14 @@ export class Adjust extends IonicNativePlugin {
|
|||||||
*/
|
*/
|
||||||
@Cordova({ sync: true })
|
@Cordova({ sync: true })
|
||||||
sendFirstPackages(): void {}
|
sendFirstPackages(): void {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request Adjust SDK to show pop up dialog for asking user's consent to be tracked.
|
||||||
|
* In order to do this, call this function
|
||||||
|
* @return {Promise<int>} Returns a promise with user's consent value
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
requestTrackingAuthorizationWithCompletionHandler(): Promise<number> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user