-
Notifications
You must be signed in to change notification settings - Fork 11
/
AppsFlyerXApple.h
159 lines (106 loc) · 5.86 KB
/
AppsFlyerXApple.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
//
// AppsFlyerXApple.h
// AppsFlyerCocos2dX
//
// Created by AndreyG-AF on 10/4/17.
//
#ifndef AppsFlyerXApple_h
#define AppsFlyerXApple_h
#include <iostream>
#include "EmailCryptTypeX.h"
//#include "libAppsFlyer/AppsFlyerLib.h"
//#include "AppsFlyerXApple.h"
//#include "AppsFlyerXAppleHelper.h"
//#include "AppsFlyerXAppleDelegate.h"
//#include "EmailCryptTypeX.h"
#include "AppsFlyerXDeepLinkResult.h"
#include "AFSDKXPurchaseDetails.h"
#include "AFSDKXValidateAndLogResult.h"
class AppsFlyerXApple {
private:
/* Here will be the instance stored. */
static AppsFlyerXApple* instance;
/* Private constructor to prevent instancing. */
AppsFlyerXApple();
void * deepLinkDelegate;
void * delegate;
public:
static AppsFlyerXApple* getInstance();
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 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 setDisableCollectASA(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 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(AFSDKXPurchaseDetails &details,
cocos2d::ValueMap params,
std::function<void(AFSDKXValidateAndLogResult)> completionHandler);
static void logAdRevenue(AFXAdRevenueData adRevenueData, cocos2d::ValueMap additionalParameters);
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);
static void handlePushNotification(cocos2d::ValueMap pushPayload);
static void registerUninstall(void* deviceToken, unsigned long length);
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 stop);
// MARK: - AppsFlyerLib delegate proxy methods
static void setOnConversionDataReceived(void(*callback)(cocos2d::ValueMap installData));
static void setOnConversionDataRequestFailure(void(*callback)(cocos2d::ValueMap error));
static void setOnAppOpenAttribution(void(*callback)(cocos2d::ValueMap attributionData));
static void setOnAppOpenAttributionFailure(void(*callback)(cocos2d::ValueMap error));
//Sharing data filter
static void sharingFilter(std::vector<std::string> partners);
static void sharingFilterForAllPartners();
static void disableSKAdNetwork(bool shouldDisable);
static bool isDisabledSKAdNetwork();
static void waitForATTUserAuthorizationWithTimeoutInterval(double timeoutInterval);
static void setPhoneNumber(const std::string& phoneNumber);
//DDL
static void setDidResolveDeepLink(void(*callback)(AppsFlyerXDeepLinkResult result));
static void setPartnerData(const 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, std::function<void(std::string url)> callback);
};
#endif /* AppsFlyerXApple_h */