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" |
e0f1c2
|
12 |
NS_ASSUME_NONNULL_BEGIN |
L |
13 |
|
d1f6ab
|
14 |
@class WACoreProxy; |
H |
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; |
d521fa
|
52 |
|
L |
53 |
|
|
54 |
/*! |
|
55 |
@abstract 初始化(20221202新增初始化回调) |
|
56 |
*/ |
|
57 |
|
|
58 |
+(void)initWithCompletionHandler:(void (^_Nullable)())completionHandler; |
|
59 |
|
|
60 |
|
d1f6ab
|
61 |
/*! |
H |
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; |
40ff0c
|
86 |
/*! |
W |
87 |
@abstract 设置clientId |
|
88 |
*/ |
|
89 |
+(void)setClientId:(NSString*)clientId; |
d1f6ab
|
90 |
/*! |
H |
91 |
@abstract 获取userId |
|
92 |
*/ |
|
93 |
+(NSString*)getUserId; |
|
94 |
/*! |
|
95 |
@abstract 设置serverId |
2e0222
|
96 |
@param serverId 服务器id |
d1f6ab
|
97 |
*/ |
H |
98 |
+(void)setServerId:(NSString *)serverId; |
|
99 |
/*! |
|
100 |
@abstract 获取serverId |
|
101 |
*/ |
|
102 |
|
|
103 |
+(NSString*)getServerId; |
|
104 |
/*! |
|
105 |
@abstract 设置level |
2e0222
|
106 |
@param level 等级 |
d1f6ab
|
107 |
*/ |
H |
108 |
+(void)setLevel:(int)level; |
|
109 |
/*! |
|
110 |
@abstract 获取level |
|
111 |
*/ |
|
112 |
+(int)getLevel; |
|
113 |
/*! |
|
114 |
@abstract 设置gameUserId |
2e0222
|
115 |
@param gameUserId 游戏userId |
d1f6ab
|
116 |
*/ |
H |
117 |
+(void)setGameUserId:(NSString*)gameUserId; |
|
118 |
/*! |
|
119 |
@abstract 获取gameUserId |
|
120 |
*/ |
|
121 |
+(NSString*)getGameUserId; |
|
122 |
/*! |
45b3f1
|
123 |
@abstract 设置nickName |
H |
124 |
@param nickName 游戏角色名 |
|
125 |
*/ |
|
126 |
+(void)setNickName:(NSString*)nickName; |
|
127 |
/*! |
|
128 |
@abstract 获取nickName |
|
129 |
*/ |
|
130 |
+(NSString*)getNickName; |
|
131 |
/*! |
|
132 |
@abstract 获取userFlag |
|
133 |
*/ |
|
134 |
+(void)setUserFlag:(NSString*)userFlag; |
|
135 |
/*! |
|
136 |
@abstract 获取userFlag |
|
137 |
*/ |
|
138 |
+(NSString*)getUserFlag; |
|
139 |
/*! |
d1f6ab
|
140 |
@abstract 获取WA Server url |
H |
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 |
/*! |
45b3f1
|
184 |
@abstract 隐私政策URL地址 |
H |
185 |
*/ |
|
186 |
+(NSString *)getPrivacyUrl; |
|
187 |
/*! |
|
188 |
@abstract 隐私政策更新时间 |
|
189 |
*/ |
|
190 |
+(NSString *)getPrivacyUpdateTime; |
|
191 |
/*! |
|
192 |
@abstract 隐私政策内容界面 |
|
193 |
*/ |
|
194 |
+(void)showPrivacyUI:(void(^)(void))privacyUIClosedHandler; |
3a96ff
|
195 |
+(void)showPrivacyUITitle:(NSString*)title url:(NSString*)url handle:(void(^)(void))privacyUIClosedHandler; |
L |
196 |
|
45b3f1
|
197 |
/*! |
d1f6ab
|
198 |
@abstract 下面两个方法是关于Facebook deeplink, CP不用关注 |
H |
199 |
*/ |
|
200 |
-(NSString*)getDeepLinkWithUrl:(NSURL*)url; |
|
201 |
|
|
202 |
+(void)fetchDeferredAppLink:(void(^)(NSURL *url, NSError *error))handler; |
|
203 |
/*! |
d0b2df
|
204 |
@abstract 获取后台配置参数 |
H |
205 |
*/ |
|
206 |
+(WAParamConfigObj*)getParamConfig; |
|
207 |
/*! |
d1f6ab
|
208 |
@abstract 下面四个方法是关于打印日志的,CP不用关注 |
H |
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 |
|
47f8fd
|
218 |
/*! |
H |
219 |
@discussion 处理UIApplicationDelegate的方法[-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions]传递过来的参数。 |
|
220 |
*/ |
|
221 |
+ (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; |
d1f6ab
|
222 |
|
47f8fd
|
223 |
#pragma mark 消息通知 |
45b3f1
|
224 |
/*! |
H |
225 |
@abstract 注册通知 |
|
226 |
*/ |
|
227 |
+ (void)application:(UIApplication *)application initPushWithDelegate:(id<UNUserNotificationCenterDelegate>)delegate API_AVAILABLE(ios(10.0)); |
d1f6ab
|
228 |
|
45b3f1
|
229 |
/*! |
H |
230 |
@abstract 调用过用户注册通知方法之后执行 |
|
231 |
*/ |
|
232 |
+ (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings API_AVAILABLE(ios(8.0)); |
47f8fd
|
233 |
|
45b3f1
|
234 |
/*! |
H |
235 |
@abstract 获取deviceToken |
|
236 |
*/ |
47f8fd
|
237 |
+ (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken; |
H |
238 |
|
45b3f1
|
239 |
/*! |
H |
240 |
@abstract 注册失败 |
|
241 |
*/ |
47f8fd
|
242 |
+ (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error; |
H |
243 |
|
|
244 |
#pragma mark IOS8 IOS9 Push Notification Receive |
45b3f1
|
245 |
/*! |
H |
246 |
@abstract 接收本地通知 |
|
247 |
*/ |
47f8fd
|
248 |
+ (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification; |
45b3f1
|
249 |
|
H |
250 |
/*! |
|
251 |
@abstract 接收远程通知 |
|
252 |
*/ |
47f8fd
|
253 |
+ (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler; |
H |
254 |
|
|
255 |
#pragma mark IOS10 Push Notification Receive |
45b3f1
|
256 |
/*! |
H |
257 |
@abstractApp 处于前台接收通知时 |
|
258 |
*/ |
|
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)); |
47f8fd
|
260 |
|
45b3f1
|
261 |
/*! |
H |
262 |
@abstract 通知的点击事件 |
|
263 |
*/ |
|
264 |
+ (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler API_AVAILABLE(ios(10.0)) API_AVAILABLE(ios(10.0)); |
47f8fd
|
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; |
|
291 |
|
45b3f1
|
292 |
+ (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options; |
H |
293 |
|
|
294 |
+ (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler API_AVAILABLE(ios(8.0)); |
|
295 |
|
e0f1c2
|
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 |
|
45b3f1
|
312 |
/*! |
H |
313 |
@abstract 设备是否越狱 |
|
314 |
*/ |
|
315 |
+ (BOOL)isJailBreak; |
|
316 |
|
28ea02
|
317 |
|
L |
318 |
|
d1f6ab
|
319 |
@end |
e0f1c2
|
320 |
NS_ASSUME_NONNULL_END |