commit | author | age
|
d1f6ab
|
1 |
// |
H |
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" |
47f8fd
|
11 |
#import "WAIPush.h" |
d1f6ab
|
12 |
@class WACoreProxy; |
H |
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; |
40ff0c
|
75 |
/*! |
W |
76 |
@abstract 设置clientId |
|
77 |
*/ |
|
78 |
+(void)setClientId:(NSString*)clientId; |
d1f6ab
|
79 |
/*! |
H |
80 |
@abstract 获取userId |
|
81 |
*/ |
|
82 |
+(NSString*)getUserId; |
|
83 |
/*! |
|
84 |
@abstract 设置serverId |
2e0222
|
85 |
@param serverId 服务器id |
d1f6ab
|
86 |
*/ |
H |
87 |
+(void)setServerId:(NSString *)serverId; |
|
88 |
/*! |
|
89 |
@abstract 获取serverId |
|
90 |
*/ |
|
91 |
|
|
92 |
+(NSString*)getServerId; |
|
93 |
/*! |
|
94 |
@abstract 设置level |
2e0222
|
95 |
@param level 等级 |
d1f6ab
|
96 |
*/ |
H |
97 |
+(void)setLevel:(int)level; |
|
98 |
/*! |
|
99 |
@abstract 获取level |
|
100 |
*/ |
|
101 |
+(int)getLevel; |
|
102 |
/*! |
|
103 |
@abstract 设置gameUserId |
2e0222
|
104 |
@param gameUserId 游戏userId |
d1f6ab
|
105 |
*/ |
H |
106 |
+(void)setGameUserId:(NSString*)gameUserId; |
|
107 |
/*! |
|
108 |
@abstract 获取gameUserId |
|
109 |
*/ |
|
110 |
+(NSString*)getGameUserId; |
|
111 |
/*! |
45b3f1
|
112 |
@abstract 设置nickName |
H |
113 |
@param nickName 游戏角色名 |
|
114 |
*/ |
|
115 |
+(void)setNickName:(NSString*)nickName; |
|
116 |
/*! |
|
117 |
@abstract 获取nickName |
|
118 |
*/ |
|
119 |
+(NSString*)getNickName; |
|
120 |
/*! |
|
121 |
@abstract 获取userFlag |
|
122 |
*/ |
|
123 |
+(void)setUserFlag:(NSString*)userFlag; |
|
124 |
/*! |
|
125 |
@abstract 获取userFlag |
|
126 |
*/ |
|
127 |
+(NSString*)getUserFlag; |
|
128 |
/*! |
d1f6ab
|
129 |
@abstract 获取WA Server url |
H |
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 |
/*! |
45b3f1
|
173 |
@abstract 隐私政策URL地址 |
H |
174 |
*/ |
|
175 |
+(NSString *)getPrivacyUrl; |
|
176 |
/*! |
|
177 |
@abstract 隐私政策更新时间 |
|
178 |
*/ |
|
179 |
+(NSString *)getPrivacyUpdateTime; |
|
180 |
/*! |
|
181 |
@abstract 隐私政策内容界面 |
|
182 |
*/ |
|
183 |
+(void)showPrivacyUI:(void(^)(void))privacyUIClosedHandler; |
|
184 |
/*! |
d1f6ab
|
185 |
@abstract 下面两个方法是关于Facebook deeplink, CP不用关注 |
H |
186 |
*/ |
|
187 |
-(NSString*)getDeepLinkWithUrl:(NSURL*)url; |
|
188 |
|
|
189 |
+(void)fetchDeferredAppLink:(void(^)(NSURL *url, NSError *error))handler; |
|
190 |
/*! |
d0b2df
|
191 |
@abstract 获取后台配置参数 |
H |
192 |
*/ |
|
193 |
+(WAParamConfigObj*)getParamConfig; |
|
194 |
/*! |
d1f6ab
|
195 |
@abstract 下面四个方法是关于打印日志的,CP不用关注 |
H |
196 |
*/ |
|
197 |
+(void)addLogWithString:(NSString*)string; |
|
198 |
|
|
199 |
+(void)addLogWithoutBtn:(NSString*)string; |
|
200 |
|
|
201 |
+(void)addEventContentWithString:(NSString*)string; |
|
202 |
|
|
203 |
+(void)eventLogWithPlatform:(NSString*)platform eventName:(NSString*)eventName parameters:(NSDictionary*)parameters color:(UIColor*)color; |
|
204 |
|
47f8fd
|
205 |
/*! |
H |
206 |
@discussion 处理UIApplicationDelegate的方法[-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions]传递过来的参数。 |
|
207 |
*/ |
|
208 |
+ (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; |
d1f6ab
|
209 |
|
47f8fd
|
210 |
#pragma mark 消息通知 |
45b3f1
|
211 |
/*! |
H |
212 |
@abstract 注册通知 |
|
213 |
*/ |
|
214 |
+ (void)application:(UIApplication *)application initPushWithDelegate:(id<UNUserNotificationCenterDelegate>)delegate API_AVAILABLE(ios(10.0)); |
d1f6ab
|
215 |
|
45b3f1
|
216 |
/*! |
H |
217 |
@abstract 调用过用户注册通知方法之后执行 |
|
218 |
*/ |
|
219 |
+ (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings API_AVAILABLE(ios(8.0)); |
47f8fd
|
220 |
|
45b3f1
|
221 |
/*! |
H |
222 |
@abstract 获取deviceToken |
|
223 |
*/ |
47f8fd
|
224 |
+ (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken; |
H |
225 |
|
45b3f1
|
226 |
/*! |
H |
227 |
@abstract 注册失败 |
|
228 |
*/ |
47f8fd
|
229 |
+ (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error; |
H |
230 |
|
|
231 |
#pragma mark IOS8 IOS9 Push Notification Receive |
45b3f1
|
232 |
/*! |
H |
233 |
@abstract 接收本地通知 |
|
234 |
*/ |
47f8fd
|
235 |
+ (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification; |
45b3f1
|
236 |
|
H |
237 |
/*! |
|
238 |
@abstract 接收远程通知 |
|
239 |
*/ |
47f8fd
|
240 |
+ (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler; |
H |
241 |
|
|
242 |
#pragma mark IOS10 Push Notification Receive |
45b3f1
|
243 |
/*! |
H |
244 |
@abstractApp 处于前台接收通知时 |
|
245 |
*/ |
|
246 |
+ (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler API_AVAILABLE(ios(10.0)) API_AVAILABLE(ios(10.0)) API_AVAILABLE(ios(10.0)); |
47f8fd
|
247 |
|
45b3f1
|
248 |
/*! |
H |
249 |
@abstract 通知的点击事件 |
|
250 |
*/ |
|
251 |
+ (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler API_AVAILABLE(ios(10.0)) API_AVAILABLE(ios(10.0)); |
47f8fd
|
252 |
|
H |
253 |
/*! |
|
254 |
程序进入后台 |
|
255 |
@discussion 处理UIApplicationDelegate的方法[- (void)applicationDidEnterBackground:(UIApplication *)application]传递过来的参数。 |
|
256 |
*/ |
|
257 |
+ (void)applicationDidEnterBackground:(UIApplication *)application; |
|
258 |
|
|
259 |
/*! |
|
260 |
程序将进入前台 |
|
261 |
@discussion 处理UIApplicationDelegate的方法[- (void)applicationWillEnterForeground:(UIApplication *)application]传递过来的参数。 |
|
262 |
*/ |
|
263 |
+ (void)applicationWillEnterForeground:(UIApplication *)application; |
|
264 |
|
|
265 |
/*! |
|
266 |
程序进入前台 |
|
267 |
@discussion 处理UIApplicationDelegate的方法[- (void)applicationDidBecomeActive:(UIApplication *)application]传递过来的参数。 |
|
268 |
*/ |
|
269 |
+ (void)applicationDidBecomeActive:(UIApplication *)application; |
|
270 |
|
|
271 |
/*! |
|
272 |
@discussion 处理UIApplicationDelegate的方法[-(BOOL)application:(UIApplication *)application |
|
273 |
openURL:(NSURL *)url |
|
274 |
sourceApplication:(NSString *)sourceApplication |
|
275 |
annotation:(id)annotation]传递过来的参数。 |
|
276 |
*/ |
|
277 |
+ (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation; |
|
278 |
|
45b3f1
|
279 |
+ (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options; |
H |
280 |
|
|
281 |
+ (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler API_AVAILABLE(ios(8.0)); |
|
282 |
|
|
283 |
/*! |
|
284 |
@abstract 设备是否越狱 |
|
285 |
*/ |
|
286 |
+ (BOOL)isJailBreak; |
|
287 |
|
28ea02
|
288 |
|
L |
289 |
|
d1f6ab
|
290 |
@end |