YS_Analytic.h
6.04 KB
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
//
// YS_Analytic.h
// YS_Analytic
//
// Created by MaxM on 16/7/5.
// Copyright © 2016年 MaxM. All rights reserved.
//
#import <Foundation/Foundation.h>
// 帐户类型
typedef enum {
kbAccountAnonymous = 0, // 匿名帐户
kbAccountRegistered = 1, // 显性注册帐户
kbAccountSinaWeibo = 2, // 新浪微博
kbAccountQQ = 3, // QQ帐户
kbAccountTencentWeibo = 4, // 腾讯微博
kbAccountND91 = 5, // 91帐户
kbAccountType1 = 11, // 预留1
kbAccountType2 = 12, // 预留2
kbAccountType3 = 13, // 预留3
kbAccountType4 = 14, // 预留4
kbAccountType5 = 15, // 预留5
kbAccountType6 = 16, // 预留6
kbAccountType7 = 17, // 预留7
kbAccountType8 = 18, // 预留8
kbAccountType9 = 19, // 预留9
kbAccountType10 = 20 // 预留10
} YSAccountType;
// 性别
typedef enum {
kbGenderUnknown = 0, // 未知
kbGenderMale = 1, // 男
kbGenderFemale = 2 // 女
} YSGender;
@interface YS_Analytic : NSObject
/**
* @brief 单例
*
* @return 单例
*/
+(YS_Analytic *)defaultAanlytic;
/** 必须调用
* @method onStart 初始化统计实例 请在application:didFinishLaunchingWithOptions:方法里调用
* @param appId appId 类型:NSString 应用的唯一标识,统计后台注册得到
* @param channelId 渠道名(可选) 类型:NSString 如“app store”
*/
- (void)onStart:(NSString *)appId withChannelId:(NSString *)channelId;
/** 必须调用
* @brief 游戏时长统计(登陆成功后调用)
*
* @param userId 登陆成功返回的userId(单机可以为空)
* @param userName 角色名
* @param zone 游戏区服
*/
- (void)gameTimeWithuserId:(NSString *)userId userName:(NSString *)userName zone:(NSString *)zone;
/**
* @method setVerboseLogDisabled 设置不显示日志 如发布时不需显示日志,应当最先调用该方法
*/
+ (void)setVerboseLogDisabled;
/*****************************************账号相关*********************************************************/
/**
* @brief 账号登陆(登陆成功后调用)
*
* @param uid 登陆成功返回的userId(单机可以为空)
* @param type 账户类型
*/
-(void)accountLoginSuccessWithUserID:(NSString *)uid accountType:(YSAccountType)type;
/**
角色登陆成功
@param uid 登陆成功返回的userId(单机可以为空)
@param uName 注册用户的角色
@param zone 用户区服务器
*/
-(void)roleLoginSuccessWithUserID:(NSString *)uid userName:(NSString *)uName userZone:(NSString *)zone;
/**
* @method setLevel 设置帐号等级
* @param level 升级之后的等级 类型:int
*/
- (void)setLevel:(int)level;
/**
* @method setGender 设置性别
* @param gender 性别 类型:TDGAGender
*/
- (void)setGender:(YSGender)gender;
/**
* @method setAge 设置年龄
* @param age 年龄 类型:int
*/
- (void)setAge:(int)age;
/**
* @brief 发言
*
* @param content 发言内容
*/
- (void)speakContent:(NSString *)content;
/****************************************任务**********************************************************/
/**
* @method onBegin 开始一项任务
* @param missionId 任务名称 类型:NSString
*/
- (void)onBegin:(NSString *)missionId;
/**
* @method onCompleted 完成一项任务
* @param missionId 任务名称 类型:NSString
*/
- (void)onCompleted:(NSString *)missionId;
/**
* @method onFailed 一项任务失败
* @param missionId 任务名称 类型:NSString
* @param failedCause 失败原因 类型:NSString
*/
- (void)onFailed:(NSString *)missionId failedCause:(NSString *)cause;
/*****************************************虚拟币*********************************************************/
/**
* @method onChargeRequst 虚拟币充值请求
* @param orderId 订单id 类型:NSString
* @param iapId 订单描述 类型:NSString
* @param currencyAmount 现金金额 类型:double
* @param currencyType 币种 类型:NSString
* @param virtualCurrencyAmount 虚拟币金额 类型:double
* @param paymentType 支付类型 类型:NSString
*/
- (void)onChargeRequst:(NSString *)orderId
iapId:(NSString *)iapId
currencyAmount:(double)currencyAmount
currencyType:(NSString *)currencyType
virtualCurrencyAmount:(double)virtualCurrencyAmount
paymentType:(NSString *)paymentType;
/**
* @method onChargeSuccess 虚拟币充值成功
* @param orderId 订单id 类型:NSString
*/
- (void)onChargeSuccess:(NSString *)orderId;
/**
* @method onReward 虚拟币赠送
* @param virtualCurrencyAmount 虚拟币金额 类型:double
* @param reason 赠送虚拟币的原因 类型:NSString
*/
- (void)onReward:(double)virtualCurrencyAmount reason:(NSString *)reason;
/****************************************虚拟物品*******************************************************/
/**
* @method onPurchase 虚拟物品购买
* @param item 道具 类型:NSString
* @param number 道具个数 类型:int
* @param price 道具单价 类型:double
*/
- (void)onPurchase:(NSString *)item itemNumber:(int)number priceInVirtualCurrency:(double)price;
/**
* @method onUse 虚拟物品消耗
* @param item 道具 类型:NSString
* @param number 道具个数 类型:int
*/
- (void)onUse:(NSString *)item itemNumber:(int)number;
/**************************************自定义事件*******************************************************/
/**
* @method onEventName 自定义事件
* @param customName 自定义事件名称
* @param custonValue 自定义事件Value
*/
- (void)onEventName:(NSString *)customName eventValue:(NSString *)custonValue;
@end