-
Notifications
You must be signed in to change notification settings - Fork 11
/
AppsFlyerX.h
174 lines (113 loc) · 6.53 KB
/
AppsFlyerX.h
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
//
// AppsFlyerX.h
// AppsFlyerCocos2dX
//
// Created by Andrey Gagan
// Copyright © 2017 AppsFlyer. All rights reserved.
//
#ifndef AppsFlyerX_h
#define AppsFlyerX_h
#include "cocos2d.h"
#include <iostream>
#include "EmailCryptTypeX.h"
#include "AppsFlyerXMacro.h"
#include "AppsFlyerXDeepLinkResult.h"
#include "AppsFlyerXConsent.cpp"
#include "AFSDKXPurchaseDetails.h"
#include "AFXAdRevenueData.h"
class AppsFlyerX {
public:
static bool manualStart;
static void setManualStart(bool isManualStart);
static void enableTCFDataCollection(bool shouldCollectConsentData);
static void setConsentData(const AppsFlyerXConsent& consentData);
static void setCustomerUserID(const std::string& customerUserID);
static std::string customerUserID();
static void setAdditionalData(cocos2d::ValueMap customData);
static cocos2d::ValueMap customData();
static void setAppsFlyerDevKey(const std::string& appsFlyerDevKey);
static std::string appsFlyerDevKey();
static void setAppleAppID(const std::string& appleAppID);
static std::string appleAppID();
static void setCurrencyCode(const std::string& currencyCode);
static std::string currencyCode();
static void disableAdvertisingIdentifier(bool shouldDisable);
static bool isDisabledAdvertisingIdentifier();
static void setIsDebug(bool isDebug);
static bool isDebug();
static void didEnterBackground();
static void setShouldCollectDeviceName(bool isShouldCollectDeviceName);
static bool isShouldCollectDeviceName();
static void setAppInviteOneLink(const std::string& appInviteOneLinkID);
static std::string appInviteOneLinkID();
static void anonymizeUser(bool shouldAnonymize);
static bool isAnonymizedUser();
static void disableCollectASA(bool shouldDisable);
static bool isDisabledCollectASA();
static void setUseReceiptValidationSandbox(bool useReceiptValidationSandbox);
static bool isUseReceiptValidationSandbox();
static void setUseUninstallSandbox(bool setUseUninstallSandbox);
static bool isUseUninstallSandbox();
static void setUserEmails(std::vector<std::string> userEmails, EmailCryptTypeX type);
static void start();
static void logEvent(const std::string& eventName, cocos2d::ValueMap values);
static void logAdRevenue(AFXAdRevenueData adRevenueData, cocos2d::ValueMap additionalParameters);
static void validateAndLogInAppPurchase(const std::string& productIdentifier,
const std::string& price,
const std::string& currency,
const std::string& tranactionId,
cocos2d::ValueMap params,
std::function<void(cocos2d::ValueMap)> successBlock,
std::function<void(cocos2d::ValueMap)> failureBlock);
static void validateAndLogInAppPurchase(const std::string& publicKey,
const std::string& signature,
const std::string& purchaseData,
const std::string& price,
const std::string& currency,
cocos2d::ValueMap additionalParameters);
static void validateAndLogInAppPurchase(AFSDKXPurchaseDetails &details, cocos2d::ValueMap params, std::function<void(AFSDKXValidateAndLogResult)> completionHandler);
static void logLocation(double longitude, double latitude);
static std::string getAppsFlyerUID();
static void handleOpenURL(const std::string& url, const std::string& sourceApplication);
static void handleOpenURL(std::string url, std::string sourceApplication, void* annotation);
static void handleOpenURL(std::string url, cocos2d::ValueMap options);
/*
- (BOOL) continueUserActivity:(NSUserActivity *) userActivity restorationHandler:(void (^)(NSArray *))restorationHandler NS_AVAILABLE_IOS(9_0);
- (void) didUpdateUserActivity:(NSUserActivity *)userActivity NS_AVAILABLE_IOS(9_0);
*/
static void handlePushNotification(cocos2d::ValueMap pushPayload);
static void registerUninstall(void* deviceToken, unsigned long length);
static void registerUninstall(const std::string& token);
// static std::string getSDKVersion();
static void remoteDebuggingCallWithData(const std::string& data);
static void setHost(const std::string& host);
static std::string getHost();
static void setMinTimeBetweenSessions(unsigned long minTimeBetweenSessions);
static unsigned long getMinTimeBetweenSessions();
static void stop(bool shouldStop);
// Delegates methods proxy
static void setOnConversionDataSuccess(void(*callback)(cocos2d::ValueMap installData));
static void setOnConversionDataFail(void(*callback)(cocos2d::ValueMap error));
static void setOnAppOpenAttribution(void(*callback)(cocos2d::ValueMap attributionData));
static void setOnAppOpenAttributionFailure(void(*callback)(cocos2d::ValueMap error));
//deprecated
static void sharingFilter(std::vector<std::string> partners);
//deprecated
static void sharingFilterForAllPartners();
static void waitForATTUserAuthorizationWithTimeoutInterval(double timeoutInterval);
static void disableSKAdNetwork(bool shouldDisable);
static bool isDisabledSKAdNetwork();
static void setPhoneNumber(const std::string& phoneNumber);
//ddl
static void setDidResolveDeepLink(void(*callback)(AppsFlyerXDeepLinkResult result));
static void setPartnerData(std::string partnerId, cocos2d::ValueMap data);
static void setOneLinkCustomDomains(std::vector<std::string> domains);
static void setCurrentDeviceLanguage(const std::string& language);
static void setSharingFilterForPartners(std::vector<std::string> partners);
//user-invite
static void logInvite(const std::string& channel, cocos2d::ValueMap parameters);
static void generateUserInviteLink(cocos2d::ValueMap parameters,void(*onResponse)(std::string url), void(*onResponseError)(std::string url));
static void generateUserInviteLink(cocos2d::ValueMap parameters, std::function<void(std::string url)> callback);
static void setDisableNetworkData(bool disable);
};
#endif /* A;ppsFlyerX_h */