-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMobClickGameAnalytics.java
219 lines (168 loc) · 6.3 KB
/
MobClickGameAnalytics.java
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
package net.mwplay.umenganalysics;
import org.robovm.apple.foundation.NSObject;
import org.robovm.objc.annotation.Method;
import org.robovm.objc.annotation.NativeClass;
//
//MobClickGameAnalytics.h
//Analytics
//
//Copyright (C) 2010-2014 Umeng.com . All rights reserved.
@NativeClass
public class MobClickGameAnalytics extends NSObject{
//@interface MobClickGameAnalytics : NSObject
//#pragma mark -
//#pragma mark user methods
/** active user sign-in.
使用sign-In函数后,如果结束该PUID的统计,需要调用sign-Off函数
@param puid : user's ID
@param provider : 不能以下划线"_"开头,使用大写字母和数字标识; 如果是上市公司,建议使用股票代码。
@return void.
*/
//+ (void)profileSignInWithPUID:(NSString *)puid;
//+ (void)profileSignInWithPUID:(NSString *)puid provider:(NSString *)provider;
@Method(selector = "profileSignInWithPUID:")
public native static void profileSignInWithPUID(String puid);
@Method(selector = "profileSignInWithPUID:provider:")
public native static void profileSignInWithPUID(String puid, String provider);
/** active user sign-off.
停止sign-in PUID的统计
@return void.
*/
//+ (void)profileSignOff;
@Method(selector = "profileSignOff")
public native static void profileSignOff();
//#pragma mark -
//#pragma mark GameLevel methods
///---------------------------------------------------------------------------------------
/// @name set game level
///---------------------------------------------------------------------------------------
/** 设置玩家的等级.
*/
/** 设置玩家等级属性.
@param level 玩家等级
@return void
*/
//+ (void)setUserLevelId:(int)level;
@Method(selector = "setUserLevelId:")
public native static void setUserLevelId(int level);
///---------------------------------------------------------------------------------------
/// @name 关卡统计
///---------------------------------------------------------------------------------------
/** 记录玩家进入关卡,通过关卡及失败的情况.
*/
/** 进入关卡.
@param level 关卡
@return void
*/
//+ (void)startLevel:(NSString *)level;
@Method(selector = "startLevel:")
public native static void startLevel(String level);
/** 通过关卡.
@param level 关卡,如果level == nil 则为当前关卡
@return void
*/
//+ (void)finishLevel:(NSString *)level;
@Method(selector = "finishLevel:")
public native static void finishLevel(String level);
/** 未通过关卡.
@param level 关卡,如果level == nil 则为当前关卡
@return void
*/
//+ (void)failLevel:(NSString *)level;
@Method(selector = "failLevel:")
public native static void failLevel(String level);
//#pragma mark -
//#pragma mark Pay methods
///---------------------------------------------------------------------------------------
/// @name 支付统计
///---------------------------------------------------------------------------------------
/** 记录玩家使用真实货币的消费情况
*/
/** 玩家支付货币兑换虚拟币.
@param cash 真实货币数量
@param source 支付渠道
@param coin 虚拟币数量
@return void
*/
//+ (void)pay:(double)cash source:(int)source coin:(double)coin;
@Method(selector = "pay:source:coin:")
public native static void pay(double cash, int source, double coin);
/** 玩家支付货币购买道具.
@param cash 真实货币数量
@param source 支付渠道
@param item 道具名称
@param amount 道具数量
@param price 道具单价
@return void
*/
//+ (void)pay:(double)cash source:(int)source item:(NSString *)item amount:(int)amount price:(double)price;
@Method(selector = "pay:source:item:amount:price:")
public native static void pay(double cash, int source, String item, int amount, double price);
//#pragma mark -
//#pragma mark Buy methods
///---------------------------------------------------------------------------------------
/// @name 虚拟币购买统计
///---------------------------------------------------------------------------------------
/** 记录玩家使用虚拟币的消费情况
*/
/** 玩家使用虚拟币购买道具
@param item 道具名称
@param amount 道具数量
@param price 道具单价
@return void
*/
//+ (void)buy:(NSString *)item amount:(int)amount price:(double)price;
@Method(selector = "buy:amount:price:")
public native static void buy(String item, int amount, double price);
//#pragma mark -
//#pragma mark Use methods
///---------------------------------------------------------------------------------------
/// @name 道具消耗统计
///---------------------------------------------------------------------------------------
/** 记录玩家道具消费情况
*/
/** 玩家使用虚拟币购买道具
@param item 道具名称
@param amount 道具数量
@param price 道具单价
@return void
*/
//+ (void)use:(NSString *)item amount:(int)amount price:(double)price;
@Method(selector = "use:amount:price:")
public native static void use(String item, int amount, double price);
//#pragma mark -
//#pragma mark Bonus methods
///---------------------------------------------------------------------------------------
/// @name 虚拟币及道具奖励统计
///---------------------------------------------------------------------------------------
/** 记录玩家获赠虚拟币及道具的情况
*/
/** 玩家获虚拟币奖励
@param coin 虚拟币数量
@param source 奖励方式
@return void
*/
//+ (void)bonus:(double)coin source:(int)source;
@Method(selector = "bonus:source:")
public native static void bonus(double coin, int source);
/** 玩家获道具奖励
@param item 道具名称
@param amount 道具数量
@param price 道具单价
@param source 奖励方式
@return void
*/
//+ (void)bonus:(NSString *)item amount:(int)amount price:(double)price source:(int)source;
@Method(selector = "bonus:amount:price:source:")
public native static void bonus(String item, int amount, double price, int source);
//#pragma mark DEPRECATED
//已经被新的setUserLevelId:方法替代,请使用新的API。
//+ (void)setUserLevel:(NSString *)level;
@Method(selector = "setUserLevel:")
public native static void setUserLevel(String level);
//已经被新的active user方法替代,请使用新的API。
//+ (void)setUserID:(NSString *)userId sex:(int)sex age:(int)age platform:(NSString *)platform;
@Method(selector = "setUserID:sex:age:platform:")
public native static void setUserID(String userId, int sex, int age, String platform);
//@end
}