1
1
#import < Foundation/Foundation.h>
2
-
3
2
NS_ASSUME_NONNULL_BEGIN
4
3
5
4
typedef struct LoginType{
6
5
NSString *loginType;
7
6
}TapDBLoginType;
8
7
8
+
9
9
/*
10
10
自定义登录方式:
11
11
TapDBLoginType customLoginType = {@"custom"};
@@ -21,8 +21,17 @@ FOUNDATION_EXPORT TapDBLoginType const TapDBLoginTypeGoogle;
21
21
FOUNDATION_EXPORT TapDBLoginType const TapDBLoginTypeTwitter;
22
22
FOUNDATION_EXPORT TapDBLoginType const TapDBLoginTypePhoneNumber;
23
23
24
+ #define TapDBSDK @" TapDB"
25
+ #define TapDBSDK_VERSION_NUMBER @" 31800001"
26
+ #define TapDBSDK_VERSION @" 3.18.0"
24
27
// 版本号
25
- static NSString *const TAPDB_VERSION = @" 3.0.5" ;
28
+ static NSString *const TAPDB_VERSION = @" 3.0.10" ;
29
+
30
+ typedef NS_ENUM (NSInteger , TapDBRegion)
31
+ {
32
+ TapDBRegionTypeCN ,
33
+ TapDBRegionTypeIO
34
+ };
26
35
27
36
@interface TapDB : NSObject
28
37
/* *
@@ -62,7 +71,8 @@ static NSString *const TAPDB_VERSION = @"3.0.5";
62
71
+ (void )onStartWithClientId : (NSString *)clientId channel : (nullable NSString *)channel version : (nullable NSString *)gameVersion ;
63
72
64
73
// sm
65
- + (void )onStartWithClientId : (NSString *)clientId channel : (nullable NSString *)channel version : (nullable NSString *)gameVersion isCN : (BOOL )isCN ;
74
+ + (void )onStartWithClientId : (NSString *)clientId channel : (nullable NSString *)channel version : (nullable NSString *)gameVersion isCN : (BOOL )isCN DEPRECATED_MSG_ATTRIBUTE(" use onStartWithClientId:channel:version:region:properties" );
75
+
66
76
/* *
67
77
* 初始化,尽早调用
68
78
* clientId: TapTap登录sdk后台页面 client id
@@ -72,18 +82,28 @@ static NSString *const TAPDB_VERSION = @"3.0.5";
72
82
*/
73
83
+ (void )onStartWithClientId : (NSString *)clientId channel : (nullable NSString *)channel version : (nullable NSString *)gameVersion properties : (nullable NSDictionary *)properties ;
74
84
85
+ /* *
86
+ * 初始化,尽早调用
87
+ * clientId: TapTap登录sdk后台页面 client id
88
+ * channel: 分包渠道名称,可为空
89
+ * gameVersion: 游戏版本,可为空,为空时,自动获取游戏安装包的版本(Xcode配置中的Version)
90
+ * region: 区域
91
+ * properties: 自定义属性
92
+ */
93
+ + (void )onStartWithClientId : (NSString *)clientId channel : (nullable NSString *)channel version : (nullable NSString *)gameVersion region : (TapDBRegion) region properties : (nullable NSDictionary *)properties ;
94
+
75
95
+ (void )setUser : (NSString *)userId ;
76
96
77
97
+ (void )setUser : (NSString *)userId properties : (nullable NSDictionary *)properties ;
78
98
// / 对外隐藏接口
79
99
+ (void )setUser : (NSString *)userId loginType : (TapDBLoginType)loginType ;
100
+
80
101
// / 记录一个用户(不是游戏角色!!!!),需要保证唯一性
81
102
// / @param userId 用户ID。不同用户需要保证ID的唯一性
82
103
// / @param loginType 登录方式
83
104
// / @param properties 自定义属性
84
105
+ (void )setUser : (NSString *)userId loginType : (TapDBLoginType)loginType properties : (nullable NSDictionary *)properties ;
85
106
86
-
87
107
/* *
88
108
登出清理用户
89
109
*/
@@ -113,16 +133,18 @@ static NSString *const TAPDB_VERSION = @"3.0.5";
113
133
// / @param name 必传,长度大于0并小于等于256,用户名
114
134
+ (void )setName : (NSString *)name ;
115
135
136
+ + (void )onChargeSuccess : (nullable NSString *)orderId product : (nullable NSString *)product amount : (NSInteger )amount currencyType : (nullable NSString *)currencyType payment : (nullable NSString *)payment ;
137
+
116
138
/* *
117
139
* 充值成功时调用
118
140
* orderId: 订单ID,可为空
119
141
* product: 产品名称,可为空
120
142
* amount: 充值金额(单位分,即无论什么币种,都需要乘以100)
121
143
* currencyType: 货币类型,可为空,参考:人民币 CNY,美元 USD;欧元 EUR
122
144
* payment: 支付方式,可为空,如:支付宝
145
+ * properties: 事件属性,需要在控制后台预先进行配置,值为长度大于0并小于等于256的字符串或绝对值小于1E11的浮点数
123
146
*/
124
- + (void )onChargeSuccess : (nullable NSString *)orderId product : (nullable NSString *)product amount : (NSInteger )amount currencyType : (nullable NSString *)currencyType payment : (nullable NSString *)payment ;
125
-
147
+ + (void )onChargeSuccess : (nullable NSString *)orderId product : (nullable NSString *)product amount : (NSInteger )amount currencyType : (nullable NSString *)currencyType payment : (nullable NSString *)payment properties : (nullable NSDictionary *)properties ;
126
148
/* *
127
149
* 自定义事件
128
150
* eventName: 事件代码,需要在控制后台预先进行配置
0 commit comments