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; |
d521fa
|
50 |
|
L |
51 |
|
|
52 |
/*! |
|
53 |
@abstract 初始化(20221202新增初始化回调) |
|
54 |
*/ |
|
55 |
|
|
56 |
+(void)initWithCompletionHandler:(void (^_Nullable)())completionHandler; |
|
57 |
|
|
58 |
|
d1f6ab
|
59 |
/*! |
H |
60 |
@abstract 设置sdk类型 0 国外,1 国内 |
|
61 |
*/ |
|
62 |
+ (void)setSDKType:(NSInteger)sdkType; |
|
63 |
/*! |
|
64 |
@abstract 获取sdk类型 0 国外,1 国内 |
|
65 |
*/ |
|
66 |
+ (NSInteger)getSDKType; |
|
67 |
/*! |
|
68 |
@abstract 开启数据收集 |
|
69 |
*/ |
|
70 |
+(void)initAppEventTracker; |
|
71 |
/*! |
|
72 |
@abstract 是否调试模式 |
|
73 |
*/ |
|
74 |
+(BOOL)isDebugMode; |
|
75 |
/*! |
|
76 |
@abstract 设置调试模式 |
|
77 |
*/ |
|
78 |
+(void)setDebugMode:(BOOL)isDebugMode; |
|
79 |
|
|
80 |
/*! |
|
81 |
@abstract 是否显示Log按钮 |
|
82 |
*/ |
|
83 |
+(BOOL)displayLog; |
40ff0c
|
84 |
/*! |
W |
85 |
@abstract 设置clientId |
|
86 |
*/ |
|
87 |
+(void)setClientId:(NSString*)clientId; |
d1f6ab
|
88 |
/*! |
H |
89 |
@abstract 获取userId |
|
90 |
*/ |
|
91 |
+(NSString*)getUserId; |
|
92 |
/*! |
|
93 |
@abstract 设置serverId |
2e0222
|
94 |
@param serverId 服务器id |
d1f6ab
|
95 |
*/ |
H |
96 |
+(void)setServerId:(NSString *)serverId; |
|
97 |
/*! |
|
98 |
@abstract 获取serverId |
|
99 |
*/ |
|
100 |
|
|
101 |
+(NSString*)getServerId; |
|
102 |
/*! |
|
103 |
@abstract 设置level |
2e0222
|
104 |
@param level 等级 |
d1f6ab
|
105 |
*/ |
H |
106 |
+(void)setLevel:(int)level; |
|
107 |
/*! |
|
108 |
@abstract 获取level |
|
109 |
*/ |
|
110 |
+(int)getLevel; |
|
111 |
/*! |
|
112 |
@abstract 设置gameUserId |
2e0222
|
113 |
@param gameUserId 游戏userId |
d1f6ab
|
114 |
*/ |
H |
115 |
+(void)setGameUserId:(NSString*)gameUserId; |
|
116 |
/*! |
|
117 |
@abstract 获取gameUserId |
|
118 |
*/ |
|
119 |
+(NSString*)getGameUserId; |
|
120 |
/*! |
45b3f1
|
121 |
@abstract 设置nickName |
H |
122 |
@param nickName 游戏角色名 |
|
123 |
*/ |
|
124 |
+(void)setNickName:(NSString*)nickName; |
|
125 |
/*! |
|
126 |
@abstract 获取nickName |
|
127 |
*/ |
|
128 |
+(NSString*)getNickName; |
|
129 |
/*! |
|
130 |
@abstract 获取userFlag |
|
131 |
*/ |
|
132 |
+(void)setUserFlag:(NSString*)userFlag; |
|
133 |
/*! |
|
134 |
@abstract 获取userFlag |
|
135 |
*/ |
|
136 |
+(NSString*)getUserFlag; |
|
137 |
/*! |
d1f6ab
|
138 |
@abstract 获取WA Server url |
H |
139 |
*/ |
|
140 |
+(NSString*)getWaSdkServerUrl; |
|
141 |
/*! |
|
142 |
@abstract 获取appKey |
|
143 |
*/ |
|
144 |
+(NSString*)getAppKey; |
|
145 |
/*! |
|
146 |
@abstract 获取Publish Channel |
|
147 |
*/ |
|
148 |
+(NSString*)getPublishChannel; |
|
149 |
/*! |
|
150 |
@abstract 获取Channel |
|
151 |
*/ |
|
152 |
+(NSString*)getChannel; |
|
153 |
/*! |
|
154 |
@abstract 获取appId |
|
155 |
*/ |
|
156 |
+(NSString*)getAppID; |
|
157 |
/*! |
|
158 |
@abstract 获取os |
|
159 |
*/ |
|
160 |
+(NSString*)getOS; |
|
161 |
/*! |
|
162 |
@abstract 获取SDK版本 |
|
163 |
*/ |
|
164 |
+(NSString*)getSdkVer; |
|
165 |
/*! |
|
166 |
@abstract 获取SDK ID |
|
167 |
*/ |
|
168 |
+(NSString *)getSdkId; |
|
169 |
/*! |
|
170 |
@abstract 获取配置文件版本 |
|
171 |
*/ |
|
172 |
+(NSString*)getXmlConfigVer; |
|
173 |
/*! |
|
174 |
@abstract 获取抽象层版本 |
|
175 |
*/ |
|
176 |
+(NSString*)getIntfVer; |
|
177 |
/*! |
|
178 |
@abstract 获取SessionId |
|
179 |
*/ |
|
180 |
+(NSString*)getSessionId; |
|
181 |
/*! |
45b3f1
|
182 |
@abstract 隐私政策URL地址 |
H |
183 |
*/ |
|
184 |
+(NSString *)getPrivacyUrl; |
|
185 |
/*! |
|
186 |
@abstract 隐私政策更新时间 |
|
187 |
*/ |
|
188 |
+(NSString *)getPrivacyUpdateTime; |
|
189 |
/*! |
|
190 |
@abstract 隐私政策内容界面 |
|
191 |
*/ |
|
192 |
+(void)showPrivacyUI:(void(^)(void))privacyUIClosedHandler; |
3a96ff
|
193 |
+(void)showPrivacyUITitle:(NSString*)title url:(NSString*)url handle:(void(^)(void))privacyUIClosedHandler; |
L |
194 |
|
45b3f1
|
195 |
/*! |
d1f6ab
|
196 |
@abstract 下面两个方法是关于Facebook deeplink, CP不用关注 |
H |
197 |
*/ |
|
198 |
-(NSString*)getDeepLinkWithUrl:(NSURL*)url; |
|
199 |
|
|
200 |
+(void)fetchDeferredAppLink:(void(^)(NSURL *url, NSError *error))handler; |
|
201 |
/*! |
d0b2df
|
202 |
@abstract 获取后台配置参数 |
H |
203 |
*/ |
|
204 |
+(WAParamConfigObj*)getParamConfig; |
|
205 |
/*! |
d1f6ab
|
206 |
@abstract 下面四个方法是关于打印日志的,CP不用关注 |
H |
207 |
*/ |
|
208 |
+(void)addLogWithString:(NSString*)string; |
|
209 |
|
|
210 |
+(void)addLogWithoutBtn:(NSString*)string; |
|
211 |
|
|
212 |
+(void)addEventContentWithString:(NSString*)string; |
|
213 |
|
|
214 |
+(void)eventLogWithPlatform:(NSString*)platform eventName:(NSString*)eventName parameters:(NSDictionary*)parameters color:(UIColor*)color; |
|
215 |
|
47f8fd
|
216 |
/*! |
H |
217 |
@discussion 处理UIApplicationDelegate的方法[-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions]传递过来的参数。 |
|
218 |
*/ |
|
219 |
+ (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; |
d1f6ab
|
220 |
|
47f8fd
|
221 |
#pragma mark 消息通知 |
45b3f1
|
222 |
/*! |
H |
223 |
@abstract 注册通知 |
|
224 |
*/ |
|
225 |
+ (void)application:(UIApplication *)application initPushWithDelegate:(id<UNUserNotificationCenterDelegate>)delegate API_AVAILABLE(ios(10.0)); |
d1f6ab
|
226 |
|
45b3f1
|
227 |
/*! |
H |
228 |
@abstract 调用过用户注册通知方法之后执行 |
|
229 |
*/ |
|
230 |
+ (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings API_AVAILABLE(ios(8.0)); |
47f8fd
|
231 |
|
45b3f1
|
232 |
/*! |
H |
233 |
@abstract 获取deviceToken |
|
234 |
*/ |
47f8fd
|
235 |
+ (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken; |
H |
236 |
|
45b3f1
|
237 |
/*! |
H |
238 |
@abstract 注册失败 |
|
239 |
*/ |
47f8fd
|
240 |
+ (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error; |
H |
241 |
|
|
242 |
#pragma mark IOS8 IOS9 Push Notification Receive |
45b3f1
|
243 |
/*! |
H |
244 |
@abstract 接收本地通知 |
|
245 |
*/ |
47f8fd
|
246 |
+ (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification; |
45b3f1
|
247 |
|
H |
248 |
/*! |
|
249 |
@abstract 接收远程通知 |
|
250 |
*/ |
47f8fd
|
251 |
+ (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler; |
H |
252 |
|
|
253 |
#pragma mark IOS10 Push Notification Receive |
45b3f1
|
254 |
/*! |
H |
255 |
@abstractApp 处于前台接收通知时 |
|
256 |
*/ |
|
257 |
+ (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
|
258 |
|
45b3f1
|
259 |
/*! |
H |
260 |
@abstract 通知的点击事件 |
|
261 |
*/ |
|
262 |
+ (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler API_AVAILABLE(ios(10.0)) API_AVAILABLE(ios(10.0)); |
47f8fd
|
263 |
|
H |
264 |
/*! |
|
265 |
程序进入后台 |
|
266 |
@discussion 处理UIApplicationDelegate的方法[- (void)applicationDidEnterBackground:(UIApplication *)application]传递过来的参数。 |
|
267 |
*/ |
|
268 |
+ (void)applicationDidEnterBackground:(UIApplication *)application; |
|
269 |
|
|
270 |
/*! |
|
271 |
程序将进入前台 |
|
272 |
@discussion 处理UIApplicationDelegate的方法[- (void)applicationWillEnterForeground:(UIApplication *)application]传递过来的参数。 |
|
273 |
*/ |
|
274 |
+ (void)applicationWillEnterForeground:(UIApplication *)application; |
|
275 |
|
|
276 |
/*! |
|
277 |
程序进入前台 |
|
278 |
@discussion 处理UIApplicationDelegate的方法[- (void)applicationDidBecomeActive:(UIApplication *)application]传递过来的参数。 |
|
279 |
*/ |
|
280 |
+ (void)applicationDidBecomeActive:(UIApplication *)application; |
|
281 |
|
|
282 |
/*! |
|
283 |
@discussion 处理UIApplicationDelegate的方法[-(BOOL)application:(UIApplication *)application |
|
284 |
openURL:(NSURL *)url |
|
285 |
sourceApplication:(NSString *)sourceApplication |
|
286 |
annotation:(id)annotation]传递过来的参数。 |
|
287 |
*/ |
|
288 |
+ (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation; |
|
289 |
|
45b3f1
|
290 |
+ (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options; |
H |
291 |
|
|
292 |
+ (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler API_AVAILABLE(ios(8.0)); |
|
293 |
|
|
294 |
/*! |
|
295 |
@abstract 设备是否越狱 |
|
296 |
*/ |
|
297 |
+ (BOOL)isJailBreak; |
|
298 |
|
28ea02
|
299 |
|
L |
300 |
|
d1f6ab
|
301 |
@end |