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" |
00c86c
|
12 |
NS_ASSUME_NONNULL_BEGIN |
L |
13 |
|
dcdc07
|
14 |
@class WACoreProxy; |
W |
15 |
|
|
16 |
#define WALog(fmt,...) {\ |
|
17 |
if([WACoreProxy displayLog]){\ |
|
18 |
NSLog((@"WASDK LOG [(version %@) %s ]:" fmt), [WACoreProxy getSdkVer],__FUNCTION__, ##__VA_ARGS__);\ |
|
19 |
[WACoreProxy addLogWithString:[NSString stringWithFormat:(@"(version %@) %s ]:" fmt),[WACoreProxy getSdkVer],__FUNCTION__, ##__VA_ARGS__]];\ |
|
20 |
}\ |
|
21 |
} |
|
22 |
|
|
23 |
#define WALogNb(fmt,...) {\ |
|
24 |
if([WACoreProxy displayLog]){\ |
|
25 |
NSLog((@"WASDK LOG [(version %@) %s ]:" fmt), [WACoreProxy getSdkVer],__FUNCTION__, ##__VA_ARGS__);\ |
|
26 |
[WACoreProxy addLogWithString:[NSString stringWithFormat:(@"(version %@) %s ]:" fmt),[WACoreProxy getSdkVer],__FUNCTION__, ##__VA_ARGS__]];\ |
|
27 |
}\ |
|
28 |
} |
|
29 |
|
|
30 |
#define WALogImpt(fmt,...) {\ |
|
31 |
NSLog((@"WASDK LOG [(version %@) %s ]:" fmt), [WACoreProxy getSdkVer],__FUNCTION__, ##__VA_ARGS__);\ |
|
32 |
if([WACoreProxy isDebugMode]){\ |
|
33 |
[WACoreProxy addLogWithString:[NSString stringWithFormat:(@"(version %@) %s ]:" fmt),[WACoreProxy getSdkVer],__FUNCTION__, ##__VA_ARGS__]];\ |
|
34 |
}\ |
|
35 |
} |
|
36 |
|
|
37 |
#define WAEventLog(fmt,...) {\ |
|
38 |
if([WACoreProxy displayLog]){\ |
|
39 |
NSLog((@"WASDK LOG [(version %@) %s ]:" fmt), [WACoreProxy getSdkVer],__FUNCTION__, ##__VA_ARGS__);\ |
|
40 |
[WACoreProxy addEventContentWithString:[NSString stringWithFormat:(@"" fmt),##__VA_ARGS__]];\ |
|
41 |
}\ |
|
42 |
} |
|
43 |
/*! |
|
44 |
@discussion WACoreProxy |
|
45 |
- - - |
|
46 |
*/ |
|
47 |
@interface WACoreProxy : NSObject |
|
48 |
/*! |
|
49 |
@abstract 初始化 |
|
50 |
*/ |
|
51 |
+(void)init; |
0ac0a6
|
52 |
|
L |
53 |
|
|
54 |
/*! |
|
55 |
@abstract 初始化(20221202新增初始化回调) |
|
56 |
*/ |
|
57 |
|
|
58 |
+(void)initWithCompletionHandler:(void (^_Nullable)())completionHandler; |
|
59 |
|
|
60 |
|
dcdc07
|
61 |
/*! |
W |
62 |
@abstract 设置sdk类型 0 国外,1 国内 |
|
63 |
*/ |
|
64 |
+ (void)setSDKType:(NSInteger)sdkType; |
|
65 |
/*! |
|
66 |
@abstract 获取sdk类型 0 国外,1 国内 |
|
67 |
*/ |
|
68 |
+ (NSInteger)getSDKType; |
|
69 |
/*! |
|
70 |
@abstract 开启数据收集 |
|
71 |
*/ |
|
72 |
+(void)initAppEventTracker; |
|
73 |
/*! |
|
74 |
@abstract 是否调试模式 |
|
75 |
*/ |
|
76 |
+(BOOL)isDebugMode; |
|
77 |
/*! |
|
78 |
@abstract 设置调试模式 |
|
79 |
*/ |
|
80 |
+(void)setDebugMode:(BOOL)isDebugMode; |
|
81 |
|
|
82 |
/*! |
|
83 |
@abstract 是否显示Log按钮 |
|
84 |
*/ |
|
85 |
+(BOOL)displayLog; |
962836
|
86 |
/*! |
W |
87 |
@abstract 设置clientId |
|
88 |
*/ |
|
89 |
+(void)setClientId:(NSString*)clientId; |
dcdc07
|
90 |
/*! |
W |
91 |
@abstract 获取userId |
|
92 |
*/ |
|
93 |
+(NSString*)getUserId; |
|
94 |
/*! |
|
95 |
@abstract 设置serverId |
962836
|
96 |
@param serverId 服务器id |
dcdc07
|
97 |
*/ |
W |
98 |
+(void)setServerId:(NSString *)serverId; |
|
99 |
/*! |
|
100 |
@abstract 获取serverId |
|
101 |
*/ |
|
102 |
|
|
103 |
+(NSString*)getServerId; |
|
104 |
/*! |
|
105 |
@abstract 设置level |
962836
|
106 |
@param level 等级 |
dcdc07
|
107 |
*/ |
W |
108 |
+(void)setLevel:(int)level; |
|
109 |
/*! |
|
110 |
@abstract 获取level |
|
111 |
*/ |
|
112 |
+(int)getLevel; |
|
113 |
/*! |
|
114 |
@abstract 设置gameUserId |
962836
|
115 |
@param gameUserId 游戏userId |
dcdc07
|
116 |
*/ |
W |
117 |
+(void)setGameUserId:(NSString*)gameUserId; |
|
118 |
/*! |
|
119 |
@abstract 获取gameUserId |
|
120 |
*/ |
|
121 |
+(NSString*)getGameUserId; |
|
122 |
/*! |
6988c5
|
123 |
@abstract 设置nickName |
H |
124 |
@param nickName 游戏角色名 |
|
125 |
*/ |
|
126 |
+(void)setNickName:(NSString*)nickName; |
|
127 |
/*! |
|
128 |
@abstract 获取nickName |
|
129 |
*/ |
|
130 |
+(NSString*)getNickName; |
|
131 |
/*! |
ff1ee0
|
132 |
@abstract 获取userFlag |
H |
133 |
*/ |
|
134 |
+(void)setUserFlag:(NSString*)userFlag; |
|
135 |
/*! |
|
136 |
@abstract 获取userFlag |
|
137 |
*/ |
|
138 |
+(NSString*)getUserFlag; |
|
139 |
/*! |
dcdc07
|
140 |
@abstract 获取WA Server url |
W |
141 |
*/ |
|
142 |
+(NSString*)getWaSdkServerUrl; |
|
143 |
/*! |
|
144 |
@abstract 获取appKey |
|
145 |
*/ |
|
146 |
+(NSString*)getAppKey; |
|
147 |
/*! |
|
148 |
@abstract 获取Publish Channel |
|
149 |
*/ |
|
150 |
+(NSString*)getPublishChannel; |
|
151 |
/*! |
|
152 |
@abstract 获取Channel |
|
153 |
*/ |
|
154 |
+(NSString*)getChannel; |
|
155 |
/*! |
|
156 |
@abstract 获取appId |
|
157 |
*/ |
|
158 |
+(NSString*)getAppID; |
|
159 |
/*! |
|
160 |
@abstract 获取os |
|
161 |
*/ |
|
162 |
+(NSString*)getOS; |
|
163 |
/*! |
|
164 |
@abstract 获取SDK版本 |
|
165 |
*/ |
|
166 |
+(NSString*)getSdkVer; |
|
167 |
/*! |
|
168 |
@abstract 获取SDK ID |
|
169 |
*/ |
|
170 |
+(NSString *)getSdkId; |
|
171 |
/*! |
|
172 |
@abstract 获取配置文件版本 |
|
173 |
*/ |
|
174 |
+(NSString*)getXmlConfigVer; |
|
175 |
/*! |
|
176 |
@abstract 获取抽象层版本 |
|
177 |
*/ |
|
178 |
+(NSString*)getIntfVer; |
|
179 |
/*! |
|
180 |
@abstract 获取SessionId |
|
181 |
*/ |
|
182 |
+(NSString*)getSessionId; |
|
183 |
/*! |
34827e
|
184 |
@abstract 隐私政策URL地址 |
H |
185 |
*/ |
|
186 |
+(NSString *)getPrivacyUrl; |
|
187 |
/*! |
|
188 |
@abstract 隐私政策更新时间 |
|
189 |
*/ |
|
190 |
+(NSString *)getPrivacyUpdateTime; |
|
191 |
/*! |
|
192 |
@abstract 隐私政策内容界面 |
|
193 |
*/ |
99a8fe
|
194 |
+(void)showPrivacyUI:(void(^)(void))privacyUIClosedHandler; |
79188b
|
195 |
+(void)showPrivacyUITitle:(NSString*)title url:(NSString*)url handle:(void(^)(void))privacyUIClosedHandler; |
L |
196 |
|
34827e
|
197 |
/*! |
dcdc07
|
198 |
@abstract 下面两个方法是关于Facebook deeplink, CP不用关注 |
W |
199 |
*/ |
|
200 |
-(NSString*)getDeepLinkWithUrl:(NSURL*)url; |
|
201 |
|
|
202 |
+(void)fetchDeferredAppLink:(void(^)(NSURL *url, NSError *error))handler; |
|
203 |
/*! |
cf3302
|
204 |
@abstract 获取后台配置参数 |
H |
205 |
*/ |
|
206 |
+(WAParamConfigObj*)getParamConfig; |
|
207 |
/*! |
dcdc07
|
208 |
@abstract 下面四个方法是关于打印日志的,CP不用关注 |
W |
209 |
*/ |
|
210 |
+(void)addLogWithString:(NSString*)string; |
|
211 |
|
|
212 |
+(void)addLogWithoutBtn:(NSString*)string; |
|
213 |
|
|
214 |
+(void)addEventContentWithString:(NSString*)string; |
|
215 |
|
|
216 |
+(void)eventLogWithPlatform:(NSString*)platform eventName:(NSString*)eventName parameters:(NSDictionary*)parameters color:(UIColor*)color; |
|
217 |
|
537198
|
218 |
/*! |
H |
219 |
@discussion 处理UIApplicationDelegate的方法[-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions]传递过来的参数。 |
|
220 |
*/ |
|
221 |
+ (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; |
dcdc07
|
222 |
|
537198
|
223 |
#pragma mark 消息通知 |
aea85e
|
224 |
/*! |
H |
225 |
@abstract 注册通知 |
|
226 |
*/ |
99a8fe
|
227 |
+ (void)application:(UIApplication *)application initPushWithDelegate:(id<UNUserNotificationCenterDelegate>)delegate API_AVAILABLE(ios(10.0)); |
537198
|
228 |
|
aea85e
|
229 |
/*! |
H |
230 |
@abstract 调用过用户注册通知方法之后执行 |
|
231 |
*/ |
99a8fe
|
232 |
+ (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings API_AVAILABLE(ios(8.0)); |
537198
|
233 |
|
aea85e
|
234 |
/*! |
H |
235 |
@abstract 获取deviceToken |
|
236 |
*/ |
537198
|
237 |
+ (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken; |
H |
238 |
|
aea85e
|
239 |
/*! |
H |
240 |
@abstract 注册失败 |
|
241 |
*/ |
537198
|
242 |
+ (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error; |
H |
243 |
|
|
244 |
#pragma mark IOS8 IOS9 Push Notification Receive |
aea85e
|
245 |
/*! |
H |
246 |
@abstract 接收本地通知 |
|
247 |
*/ |
537198
|
248 |
+ (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification; |
aea85e
|
249 |
|
H |
250 |
/*! |
|
251 |
@abstract 接收远程通知 |
|
252 |
*/ |
537198
|
253 |
+ (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler; |
H |
254 |
|
|
255 |
#pragma mark IOS10 Push Notification Receive |
aea85e
|
256 |
/*! |
H |
257 |
@abstractApp 处于前台接收通知时 |
|
258 |
*/ |
99a8fe
|
259 |
+ (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)); |
537198
|
260 |
|
aea85e
|
261 |
/*! |
H |
262 |
@abstract 通知的点击事件 |
|
263 |
*/ |
99a8fe
|
264 |
+ (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler API_AVAILABLE(ios(10.0)) API_AVAILABLE(ios(10.0)); |
537198
|
265 |
|
H |
266 |
/*! |
|
267 |
程序进入后台 |
|
268 |
@discussion 处理UIApplicationDelegate的方法[- (void)applicationDidEnterBackground:(UIApplication *)application]传递过来的参数。 |
|
269 |
*/ |
|
270 |
+ (void)applicationDidEnterBackground:(UIApplication *)application; |
|
271 |
|
|
272 |
/*! |
|
273 |
程序将进入前台 |
|
274 |
@discussion 处理UIApplicationDelegate的方法[- (void)applicationWillEnterForeground:(UIApplication *)application]传递过来的参数。 |
|
275 |
*/ |
|
276 |
+ (void)applicationWillEnterForeground:(UIApplication *)application; |
|
277 |
|
|
278 |
/*! |
|
279 |
程序进入前台 |
|
280 |
@discussion 处理UIApplicationDelegate的方法[- (void)applicationDidBecomeActive:(UIApplication *)application]传递过来的参数。 |
|
281 |
*/ |
|
282 |
+ (void)applicationDidBecomeActive:(UIApplication *)application; |
|
283 |
|
|
284 |
/*! |
|
285 |
@discussion 处理UIApplicationDelegate的方法[-(BOOL)application:(UIApplication *)application |
|
286 |
openURL:(NSURL *)url |
|
287 |
sourceApplication:(NSString *)sourceApplication |
|
288 |
annotation:(id)annotation]传递过来的参数。 |
|
289 |
*/ |
|
290 |
+ (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation; |
dcdc07
|
291 |
|
34827e
|
292 |
+ (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options; |
H |
293 |
|
99a8fe
|
294 |
+ (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler API_AVAILABLE(ios(8.0)); |
aea85e
|
295 |
|
d814a6
|
296 |
//当一个新的场景被创建时调用,可以在这个方法中配置场景。 |
L |
297 |
+ (void)scene:(UIScene *_Nonnull)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *_Nonnull)connectionOptions API_AVAILABLE(ios(13.0)); |
|
298 |
// 当场景被销毁时调用。 |
|
299 |
+ (void)sceneDidDisconnect:(UIScene *_Nonnull)scene API_AVAILABLE(ios(13.0)); |
|
300 |
//当场景变成活跃状态时调用。 |
|
301 |
+ (void)sceneDidBecomeActive:(UIScene *_Nonnull)scene API_AVAILABLE(ios(13.0)); |
|
302 |
//当场景将要变成非活跃状态时调用。 |
|
303 |
+ (void)sceneWillResignActive:(UIScene *_Nonnull)scene API_AVAILABLE(ios(13.0)); |
|
304 |
//当应用程序即将进入前台时调用。 |
|
305 |
+ (void)sceneWillEnterForeground:(UIScene *_Nonnull)scene API_AVAILABLE(ios(13.0)); |
|
306 |
//当应用程序进入后台时调用。 |
|
307 |
+ (void)sceneDidEnterBackground:(UIScene *_Nonnull)scene API_AVAILABLE(ios(13.0)); |
|
308 |
//当别的APP通过URL地址,打开我们的app时调用 |
|
309 |
+ (void)scene:(UIScene *_Nonnull)scene openURLContexts:(NSSet<UIOpenURLContext *> *_Nonnull)URLContexts API_AVAILABLE(ios(13.0)); |
|
310 |
+ (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity API_AVAILABLE(ios(13.0)); |
|
311 |
|
aea85e
|
312 |
/*! |
H |
313 |
@abstract 设备是否越狱 |
|
314 |
*/ |
|
315 |
+ (BOOL)isJailBreak; |
|
316 |
|
1ac090
|
317 |
|
L |
318 |
|
dcdc07
|
319 |
@end |
00c86c
|
320 |
NS_ASSUME_NONNULL_END |