forked from AppsFlyerSDK/appsflyer-react-native-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
113 lines (103 loc) · 4.68 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/**
* Typescript Definition Sync with v5.1.1
**/
declare module "react-native-appsflyer" {
type Response<T> = void | Promise<T>;
type SuccessCB = (result?: any) => any;
type ErrorCB = (error?: any) => any;
export type ConversionData = {
status: "success" | "failure",
type: "onAppOpenAttribution"
| "onInstallConversionDataLoaded"
| "onAttributionFailure"
| "onInstallConversionFailure"
data: {
is_first_launch: "true" | "false";
media_source: string;
campaign: string;
af_status: "Organic" | "Non-organic";
[key: string]: any;
}
}
export enum AF_EMAIL_CRYPT_TYPE {
NONE,
SHA256
}
export interface InitSDKOptions {
devKey: string;
appId?: string; // iOS only
isDebug?: boolean;
onInstallConversionDataListener?: boolean;
onDeepLinkListener?: boolean;
timeToWaitForATTUserAuthorization?: number; // iOS only
}
export interface InAppPurchase {
publicKey: string;
productIdentifier: string;
signature: string;
transactionId: string;
purchaseData: string;
price: string;
currency: string;
additionalParameters?: object;
}
export interface SetEmailsOptions {
emails?: string[];
emailsCryptType: AF_EMAIL_CRYPT_TYPE | 0 | 3;
}
export interface GenerateInviteLinkParams {
channel: string;
campaign?: string;
customerID?: string;
userParams?: object;
[key: string]: any;
}
const appsFlyer: {
onInstallConversionData(callback: (data: ConversionData) => any): () => void;
onInstallConversionFailure(callback: (data: ConversionData) => any): () => void;
onAppOpenAttribution(callback: (data: any) => any): () => void;
onAttributionFailure(callback: (data: any) => any): () => void;
onDeepLink(callback: (data: any) => any): () => void;
initSdk(options: InitSDKOptions): Promise<string>;
initSdk(options: InitSDKOptions, successC: SuccessCB, errorC: ErrorCB): void;
logEvent(eventName: string, eventValues: object): Promise<string>;
logEvent(eventName: string, eventValues: object, successC: SuccessCB, errorC: ErrorCB): void;
setUserEmails(options: SetEmailsOptions, successC: SuccessCB, errorC: ErrorCB): void
setAdditionalData(additionalData: object, successC?: SuccessCB): void
getAppsFlyerUID(callback: (error: Error, uid: string) => any): void
setCustomerUserId(userId: string, successC?: SuccessCB): void
stop(isStopped: boolean, successC?: SuccessCB): void
setAppInviteOneLinkID(oneLinkID: string, successC?: SuccessCB): void
generateInviteLink(params: GenerateInviteLinkParams, successC: SuccessCB, errorC: ErrorCB): void
logCrossPromotionImpression(appId: string, campaign: string, parameters: object): void
logCrossPromotionAndOpenStore(appId: string, campaign: string, params: object): void
setCurrencyCode(currencyCode: string, successC?: SuccessCB): void
anonymizeUser(shouldAnonymize: boolean, successC?: SuccessCB): void
setOneLinkCustomDomains(domains: string[], successC: SuccessCB, errorC: ErrorCB): void
setResolveDeepLinkURLs(urls: string[], successC: SuccessCB, errorC: ErrorCB): void
performOnAppAttribution(urlString, successC: SuccessCB, errorC: ErrorCB): void
setSharingFilterForAllPartners(): void
setSharingFilter(partners, successC, errorC): void
logLocation(longitude: number, latitude: number, successC?: SuccessCB): void
validateAndLogInAppPurchase(purchaseInfo: InAppPurchase, successC, errorC): Response<string>
updateServerUninstallToken(token: string, successC?: SuccessCB): void
sendPushNotificationData(pushPayload: object): void
setHost(hostPrefix: string, hostName: string, success: SuccessCB): void
addPushNotificationDeepLinkPath(path: string[], successC: SuccessCB, errorC: ErrorCB): void
disableAdvertisingIdentifier(isDisable: boolean): void
setSharingFilterForPartners(partners: string[]): void
/**
* For iOS Only
* */
disableCollectASA(shouldDisable: boolean): void
setUseReceiptValidationSandbox(isSandbox: boolean): void
disableSKAD(disableSkad: boolean): void
setCurrentDeviceLanguage(language: string): void
/**
* For Android Only
* */
setCollectIMEI(isCollect: boolean, successC?: SuccessCB): void
setCollectAndroidID(isCollect: boolean, successC?: SuccessCB): void
};
export default appsFlyer;
}