-
Notifications
You must be signed in to change notification settings - Fork 200
/
index.d.ts
214 lines (200 loc) · 8.01 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
/**
* Typescript Definition Sync with v5.1.1
**/
declare module "react-native-appsflyer" {
type Response<T> = void | Promise<T>;
type SuccessCB = (result?: unknown) => unknown;
type ErrorCB = (error?: Error) => unknown;
export type ConversionData = {
status: "success" | "failure",
type: "onInstallConversionDataLoaded" | "onInstallConversionFailure"
data: {
is_first_launch: "true" | "false";
media_source: string;
campaign: string;
af_status: "Organic" | "Non-organic";
[key: string]: any;
}
}
export type OnAppOpenAttributionData = {
status: "success" | "failure",
type: "onAppOpenAttribution" | "onAttributionFailure"
data: {
af_dp?: string;
is_retargeting?: string,
af_channel?: string,
af_cost_currency?: string,
c?: string;
af_adset?: string,
af_click_lookback: string,
deep_link_sub1?: string;
campaign: string;
deep_link_value: string;
link: string;
media_source: string;
pid?: string;
path?: string // Uri-Scheme
host?: string // Uri-Scheme
shortlink?: string // Uri-Scheme
scheme?: string // Uri-Scheme
af_sub1?: string;
af_sub2?: string;
af_sub3?: string;
af_sub4?: string;
af_sub5?: string;
[key: string]: any;
}
}
export type UnifiedDeepLinkData = {
status: "success" | "failure",
type: "onDeepLinking",
deepLinkStatus: 'FOUND' | 'NOT_FOUND' | 'Error',
isDeferred: boolean,
data: {
campaign: string;
deep_link_value: string;
deep_link_sub1?: string;
media_source: string;
pid?: string;
link: string,
af_sub1?: string;
af_sub2?: string;
af_sub3?: string;
af_sub4?: string;
af_sub5?: string;
[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
manualStart?: boolean
}
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?: {
deep_link_value?: string;
[key: string]: any;
};
referrerName?: string;
referrerImageUrl?: string;
deeplinkPath?: string;
baseDeeplink?: string;
brandDomain?: string;
}
export const AppsFlyerConsent: {
forGDPRUser: (hasConsentForDataUsage: boolean, hasConsentForAdsPersonalization: boolean) => AppsFlyerConsentType;
forNonGDPRUser: () => AppsFlyerConsentType;
}
export interface AppsFlyerConsentType {
isUserSubjectToGDPR: boolean;
hasConsentForDataUsage?: boolean;
hasConsentForAdsPersonalization?: boolean;
}
//Log Ad Revenue Section
export enum MEDIATION_NETWORK {
IRONSOURCE ,
APPLOVIN_MAX ,
GOOGLE_ADMOB ,
FYBER ,
APPODEAL ,
ADMOST ,
TOPON ,
TRADPLUS,
YANDEX ,
CHARTBOOST ,
UNITY ,
TOPON_PTE ,
CUSTOM_MEDIATION ,
DIRECT_MONETIZATION_NETWORK
}
//Interface representing ad revenue information
export interface AFAdRevenueData {
monetizationNetwork: string;
mediationNetwork: MEDIATION_NETWORK;
currencyIso4217Code: string;
revenue: number;
additionalParameters?: StringMap;
}
const appsFlyer: {
onInstallConversionData(callback: (data: ConversionData) => any): () => void;
onInstallConversionFailure(callback: (data: ConversionData) => any): () => void;
onAppOpenAttribution(callback: (data: OnAppOpenAttributionData) => any): () => void;
onAttributionFailure(callback: (data: OnAppOpenAttributionData) => any): () => void;
onDeepLink(callback: (data: UnifiedDeepLinkData) => 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: string, successC: SuccessCB, errorC: ErrorCB): void
setSharingFilterForAllPartners(): void
setSharingFilter(partners: string[], successC?: SuccessCB, errorC?: ErrorCB): void
logLocation(longitude: number, latitude: number, successC?: SuccessCB): void
validateAndLogInAppPurchase(purchaseInfo: InAppPurchase, successC: SuccessCB, errorC: ErrorCB): Response<string>
updateServerUninstallToken(token: string, successC?: SuccessCB): void
sendPushNotificationData(pushPayload: object, errorC?: ErrorCB): 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
setPartnerData(partnerId: string, partnerData: object): void
appendParametersToDeepLinkingURL(contains: string, parameters: object): void
startSdk(): void
enableTCFDataCollection(enabled: boolean): void
setConsentData(consentData: AppsFlyerConsentType): void
logAdRevenue(adRevenueData: AFAdRevenueData) : void
/**
* For iOS Only
* */
disableCollectASA(shouldDisable: boolean): void
setUseReceiptValidationSandbox(isSandbox: boolean): void
disableSKAD(disableSkad: boolean): void
setCurrentDeviceLanguage(language: string): void
disableIDFVCollection(shouldDisable: boolean): void
/**
* For Android Only
* */
setCollectIMEI(isCollect: boolean, successC?: SuccessCB): void
setCollectAndroidID(isCollect: boolean, successC?: SuccessCB): void
setDisableNetworkData(disable: boolean): void
performOnDeepLinking(): void
};
export default appsFlyer;
}