commit | author | age
|
dcdc07
|
1 |
// |
W |
2 |
// WACoreProxy.h |
|
3 |
// WASdkIntfUI |
|
4 |
// |
|
5 |
// Created by wuyx on 16/3/1. |
|
6 |
// Copyright © 2016年 GHW-T-01. All rights reserved. |
|
7 |
// |
|
8 |
|
|
9 |
#import <Foundation/Foundation.h> |
|
10 |
#import "WACore.h" |
537198
|
11 |
#import "WAIPush.h" |
dcdc07
|
12 |
@class WACoreProxy; |
W |
13 |
|
|
14 |
#define WALog(fmt,...) {\ |
|
15 |
if([WACoreProxy displayLog]){\ |
|
16 |
NSLog((@"WASDK LOG [(version %@) %s ]:" fmt), [WACoreProxy getSdkVer],__FUNCTION__, ##__VA_ARGS__);\ |
|
17 |
[WACoreProxy addLogWithString:[NSString stringWithFormat:(@"(version %@) %s ]:" fmt),[WACoreProxy getSdkVer],__FUNCTION__, ##__VA_ARGS__]];\ |
|
18 |
}\ |
|
19 |
} |
|
20 |
|
|
21 |
#define WALogNb(fmt,...) {\ |
|
22 |
if([WACoreProxy displayLog]){\ |
|
23 |
NSLog((@"WASDK LOG [(version %@) %s ]:" fmt), [WACoreProxy getSdkVer],__FUNCTION__, ##__VA_ARGS__);\ |
|
24 |
[WACoreProxy addLogWithString:[NSString stringWithFormat:(@"(version %@) %s ]:" fmt),[WACoreProxy getSdkVer],__FUNCTION__, ##__VA_ARGS__]];\ |
|
25 |
}\ |
|
26 |
} |
|
27 |
|
|
28 |
#define WALogImpt(fmt,...) {\ |
|
29 |
NSLog((@"WASDK LOG [(version %@) %s ]:" fmt), [WACoreProxy getSdkVer],__FUNCTION__, ##__VA_ARGS__);\ |
|
30 |
if([WACoreProxy isDebugMode]){\ |
|
31 |
[WACoreProxy addLogWithString:[NSString stringWithFormat:(@"(version %@) %s ]:" fmt),[WACoreProxy getSdkVer],__FUNCTION__, ##__VA_ARGS__]];\ |
|
32 |
}\ |
|
33 |
} |
|
34 |
|
|
35 |
#define WAEventLog(fmt,...) {\ |
|
36 |
if([WACoreProxy displayLog]){\ |
|
37 |
NSLog((@"WASDK LOG [(version %@) %s ]:" fmt), [WACoreProxy getSdkVer],__FUNCTION__, ##__VA_ARGS__);\ |
|
38 |
[WACoreProxy addEventContentWithString:[NSString stringWithFormat:(@"" fmt),##__VA_ARGS__]];\ |
|
39 |
}\ |
|
40 |
} |
|
41 |
/*! |
|
42 |
@discussion WACoreProxy |
|
43 |
- - - |
|
44 |
*/ |
|
45 |
@interface WACoreProxy : NSObject |
|
46 |
/*! |
|
47 |
@abstract 初始化 |
|
48 |
*/ |
|
49 |
+(void)init; |
|
50 |
/*! |
|
51 |
@abstract 设置sdk类型 0 国外,1 国内 |
|
52 |
*/ |
|
53 |
+ (void)setSDKType:(NSInteger)sdkType; |
|
54 |
/*! |
|
55 |
@abstract 获取sdk类型 0 国外,1 国内 |
|
56 |
*/ |
|
57 |
+ (NSInteger)getSDKType; |
|
58 |
/*! |
|
59 |
@abstract 开启数据收集 |
|
60 |
*/ |
|
61 |
+(void)initAppEventTracker; |
|
62 |
/*! |
|
63 |
@abstract 是否调试模式 |
|
64 |
*/ |
|
65 |
+(BOOL)isDebugMode; |
|
66 |
/*! |
|
67 |
@abstract 设置调试模式 |
|
68 |
*/ |
|
69 |
+(void)setDebugMode:(BOOL)isDebugMode; |
|
70 |
|
|
71 |
/*! |
|
72 |
@abstract 是否显示Log按钮 |
|
73 |
*/ |
|
74 |
+(BOOL)displayLog; |
962836
|
75 |
/*! |
W |
76 |
@abstract 设置clientId |
|
77 |
*/ |
|
78 |
+(void)setClientId:(NSString*)clientId; |
dcdc07
|
79 |
/*! |
W |
80 |
@abstract 获取userId |
|
81 |
*/ |
|
82 |
+(NSString*)getUserId; |
|
83 |
/*! |
|
84 |
@abstract 设置serverId |
962836
|
85 |
@param serverId 服务器id |
dcdc07
|
86 |
*/ |
W |
87 |
+(void)setServerId:(NSString *)serverId; |
|
88 |
/*! |
|
89 |
@abstract 获取serverId |
|
90 |
*/ |
|
91 |
|
|
92 |
+(NSString*)getServerId; |
|
93 |
/*! |
|
94 |
@abstract 设置level |
962836
|
95 |
@param level 等级 |
dcdc07
|
96 |
*/ |
W |
97 |
+(void)setLevel:(int)level; |
|
98 |
/*! |
|
99 |
@abstract 获取level |
|
100 |
*/ |
|
101 |
+(int)getLevel; |
|
102 |
/*! |
|
103 |
@abstract 设置gameUserId |
962836
|
104 |
@param gameUserId 游戏userId |
dcdc07
|
105 |
*/ |
W |
106 |
+(void)setGameUserId:(NSString*)gameUserId; |
|
107 |
/*! |
|
108 |
@abstract 获取gameUserId |
|
109 |
*/ |
|
110 |
+(NSString*)getGameUserId; |
|
111 |
/*! |
6988c5
|
112 |
@abstract 设置nickName |
H |
113 |
@param nickName 游戏角色名 |
|
114 |
*/ |
|
115 |
+(void)setNickName:(NSString*)nickName; |
|
116 |
/*! |
|
117 |
@abstract 获取nickName |
|
118 |
*/ |
|
119 |
+(NSString*)getNickName; |
|
120 |
/*! |
ff1ee0
|
121 |
@abstract 获取userFlag |
H |
122 |
*/ |
|
123 |
+(void)setUserFlag:(NSString*)userFlag; |
|
124 |
/*! |
|
125 |
@abstract 获取userFlag |
|
126 |
*/ |
|
127 |
+(NSString*)getUserFlag; |
|
128 |
/*! |
dcdc07
|
129 |
@abstract 获取WA Server url |
W |
130 |
*/ |
|
131 |
+(NSString*)getWaSdkServerUrl; |
|
132 |
/*! |
|
133 |
@abstract 获取appKey |
|
134 |
*/ |
|
135 |
+(NSString*)getAppKey; |
|
136 |
/*! |
|
137 |
@abstract 获取Publish Channel |
|
138 |
*/ |
|
139 |
+(NSString*)getPublishChannel; |
|
140 |
/*! |
|
141 |
@abstract 获取Channel |
|
142 |
*/ |
|
143 |
+(NSString*)getChannel; |
|
144 |
/*! |
|
145 |
@abstract 获取appId |
|
146 |
*/ |
|
147 |
+(NSString*)getAppID; |
|
148 |
/*! |
|
149 |
@abstract 获取os |
|
150 |
*/ |
|
151 |
+(NSString*)getOS; |
|
152 |
/*! |
|
153 |
@abstract 获取SDK版本 |
|
154 |
*/ |
|
155 |
+(NSString*)getSdkVer; |
|
156 |
/*! |
|
157 |
@abstract 获取SDK ID |
|
158 |
*/ |
|
159 |
+(NSString *)getSdkId; |
|
160 |
/*! |
|
161 |
@abstract 获取配置文件版本 |
|
162 |
*/ |
|
163 |
+(NSString*)getXmlConfigVer; |
|
164 |
/*! |
|
165 |
@abstract 获取抽象层版本 |
|
166 |
*/ |
|
167 |
+(NSString*)getIntfVer; |
|
168 |
/*! |
|
169 |
@abstract 获取SessionId |
|
170 |
*/ |
|
171 |
+(NSString*)getSessionId; |
|
172 |
/*! |
|
173 |
@abstract 下面两个方法是关于Facebook deeplink, CP不用关注 |
|
174 |
*/ |
|
175 |
-(NSString*)getDeepLinkWithUrl:(NSURL*)url; |
|
176 |
|
|
177 |
+(void)fetchDeferredAppLink:(void(^)(NSURL *url, NSError *error))handler; |
|
178 |
/*! |
cf3302
|
179 |
@abstract 获取后台配置参数 |
H |
180 |
*/ |
|
181 |
+(WAParamConfigObj*)getParamConfig; |
|
182 |
/*! |
dcdc07
|
183 |
@abstract 下面四个方法是关于打印日志的,CP不用关注 |
W |
184 |
*/ |
|
185 |
+(void)addLogWithString:(NSString*)string; |
|
186 |
|
|
187 |
+(void)addLogWithoutBtn:(NSString*)string; |
|
188 |
|
|
189 |
+(void)addEventContentWithString:(NSString*)string; |
|
190 |
|
|
191 |
+(void)eventLogWithPlatform:(NSString*)platform eventName:(NSString*)eventName parameters:(NSDictionary*)parameters color:(UIColor*)color; |
|
192 |
|
537198
|
193 |
/*! |
H |
194 |
@discussion 处理UIApplicationDelegate的方法[-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions]传递过来的参数。 |
|
195 |
*/ |
|
196 |
+ (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; |
dcdc07
|
197 |
|
537198
|
198 |
#pragma mark 消息通知 |
aea85e
|
199 |
/*! |
H |
200 |
@abstract 注册通知 |
|
201 |
*/ |
537198
|
202 |
+ (void)application:(UIApplication *)application initPushWithDelegate:(id<UNUserNotificationCenterDelegate>)delegate; |
H |
203 |
|
aea85e
|
204 |
/*! |
H |
205 |
@abstract 调用过用户注册通知方法之后执行 |
|
206 |
*/ |
537198
|
207 |
+ (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings; |
H |
208 |
|
aea85e
|
209 |
/*! |
H |
210 |
@abstract 获取deviceToken |
|
211 |
*/ |
537198
|
212 |
+ (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken; |
H |
213 |
|
aea85e
|
214 |
/*! |
H |
215 |
@abstract 注册失败 |
|
216 |
*/ |
537198
|
217 |
+ (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error; |
H |
218 |
|
|
219 |
#pragma mark IOS8 IOS9 Push Notification Receive |
aea85e
|
220 |
/*! |
H |
221 |
@abstract 接收本地通知 |
|
222 |
*/ |
537198
|
223 |
+ (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification; |
aea85e
|
224 |
|
H |
225 |
/*! |
|
226 |
@abstract 接收远程通知 |
|
227 |
*/ |
537198
|
228 |
+ (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler; |
H |
229 |
|
|
230 |
#pragma mark IOS10 Push Notification Receive |
aea85e
|
231 |
/*! |
H |
232 |
@abstractApp 处于前台接收通知时 |
|
233 |
*/ |
537198
|
234 |
+ (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler; |
H |
235 |
|
aea85e
|
236 |
/*! |
H |
237 |
@abstract 通知的点击事件 |
|
238 |
*/ |
537198
|
239 |
+ (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)())completionHandler; |
H |
240 |
|
|
241 |
/*! |
|
242 |
程序进入后台 |
|
243 |
@discussion 处理UIApplicationDelegate的方法[- (void)applicationDidEnterBackground:(UIApplication *)application]传递过来的参数。 |
|
244 |
*/ |
|
245 |
+ (void)applicationDidEnterBackground:(UIApplication *)application; |
|
246 |
|
|
247 |
/*! |
|
248 |
程序将进入前台 |
|
249 |
@discussion 处理UIApplicationDelegate的方法[- (void)applicationWillEnterForeground:(UIApplication *)application]传递过来的参数。 |
|
250 |
*/ |
|
251 |
+ (void)applicationWillEnterForeground:(UIApplication *)application; |
|
252 |
|
|
253 |
/*! |
|
254 |
程序进入前台 |
|
255 |
@discussion 处理UIApplicationDelegate的方法[- (void)applicationDidBecomeActive:(UIApplication *)application]传递过来的参数。 |
|
256 |
*/ |
|
257 |
+ (void)applicationDidBecomeActive:(UIApplication *)application; |
|
258 |
|
|
259 |
/*! |
|
260 |
@discussion 处理UIApplicationDelegate的方法[-(BOOL)application:(UIApplication *)application |
|
261 |
openURL:(NSURL *)url |
|
262 |
sourceApplication:(NSString *)sourceApplication |
|
263 |
annotation:(id)annotation]传递过来的参数。 |
|
264 |
*/ |
|
265 |
+ (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation; |
dcdc07
|
266 |
|
1417b8
|
267 |
+ (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options; |
aea85e
|
268 |
|
H |
269 |
/*! |
|
270 |
@abstract 设备是否越狱 |
|
271 |
*/ |
|
272 |
+ (BOOL)isJailBreak; |
|
273 |
|
dcdc07
|
274 |
@end |