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 |
/*! |
dcdc07
|
121 |
@abstract 获取WA Server url |
W |
122 |
*/ |
|
123 |
+(NSString*)getWaSdkServerUrl; |
|
124 |
/*! |
|
125 |
@abstract 获取appKey |
|
126 |
*/ |
|
127 |
+(NSString*)getAppKey; |
|
128 |
/*! |
|
129 |
@abstract 获取Publish Channel |
|
130 |
*/ |
|
131 |
+(NSString*)getPublishChannel; |
|
132 |
/*! |
|
133 |
@abstract 获取Channel |
|
134 |
*/ |
|
135 |
+(NSString*)getChannel; |
|
136 |
/*! |
|
137 |
@abstract 获取appId |
|
138 |
*/ |
|
139 |
+(NSString*)getAppID; |
|
140 |
/*! |
|
141 |
@abstract 获取os |
|
142 |
*/ |
|
143 |
+(NSString*)getOS; |
|
144 |
/*! |
|
145 |
@abstract 获取SDK版本 |
|
146 |
*/ |
|
147 |
+(NSString*)getSdkVer; |
|
148 |
/*! |
|
149 |
@abstract 获取SDK ID |
|
150 |
*/ |
|
151 |
+(NSString *)getSdkId; |
|
152 |
/*! |
|
153 |
@abstract 获取配置文件版本 |
|
154 |
*/ |
|
155 |
+(NSString*)getXmlConfigVer; |
|
156 |
/*! |
|
157 |
@abstract 获取抽象层版本 |
|
158 |
*/ |
|
159 |
+(NSString*)getIntfVer; |
|
160 |
/*! |
|
161 |
@abstract 获取SessionId |
|
162 |
*/ |
|
163 |
+(NSString*)getSessionId; |
|
164 |
/*! |
|
165 |
@abstract 下面两个方法是关于Facebook deeplink, CP不用关注 |
|
166 |
*/ |
|
167 |
-(NSString*)getDeepLinkWithUrl:(NSURL*)url; |
|
168 |
|
|
169 |
+(void)fetchDeferredAppLink:(void(^)(NSURL *url, NSError *error))handler; |
|
170 |
/*! |
cf3302
|
171 |
@abstract 获取后台配置参数 |
H |
172 |
*/ |
|
173 |
+(WAParamConfigObj*)getParamConfig; |
|
174 |
/*! |
dcdc07
|
175 |
@abstract 下面四个方法是关于打印日志的,CP不用关注 |
W |
176 |
*/ |
|
177 |
+(void)addLogWithString:(NSString*)string; |
|
178 |
|
|
179 |
+(void)addLogWithoutBtn:(NSString*)string; |
|
180 |
|
|
181 |
+(void)addEventContentWithString:(NSString*)string; |
|
182 |
|
|
183 |
+(void)eventLogWithPlatform:(NSString*)platform eventName:(NSString*)eventName parameters:(NSDictionary*)parameters color:(UIColor*)color; |
|
184 |
|
537198
|
185 |
/*! |
H |
186 |
@discussion 处理UIApplicationDelegate的方法[-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions]传递过来的参数。 |
|
187 |
*/ |
|
188 |
+ (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; |
dcdc07
|
189 |
|
537198
|
190 |
#pragma mark 消息通知 |
aea85e
|
191 |
/*! |
H |
192 |
@abstract 注册通知 |
|
193 |
*/ |
537198
|
194 |
+ (void)application:(UIApplication *)application initPushWithDelegate:(id<UNUserNotificationCenterDelegate>)delegate; |
H |
195 |
|
aea85e
|
196 |
/*! |
H |
197 |
@abstract 调用过用户注册通知方法之后执行 |
|
198 |
*/ |
537198
|
199 |
+ (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings; |
H |
200 |
|
aea85e
|
201 |
/*! |
H |
202 |
@abstract 获取deviceToken |
|
203 |
*/ |
537198
|
204 |
+ (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken; |
H |
205 |
|
aea85e
|
206 |
/*! |
H |
207 |
@abstract 注册失败 |
|
208 |
*/ |
537198
|
209 |
+ (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error; |
H |
210 |
|
|
211 |
#pragma mark IOS8 IOS9 Push Notification Receive |
aea85e
|
212 |
/*! |
H |
213 |
@abstract 接收本地通知 |
|
214 |
*/ |
537198
|
215 |
+ (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification; |
aea85e
|
216 |
|
H |
217 |
/*! |
|
218 |
@abstract 接收远程通知 |
|
219 |
*/ |
537198
|
220 |
+ (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler; |
H |
221 |
|
|
222 |
#pragma mark IOS10 Push Notification Receive |
aea85e
|
223 |
/*! |
H |
224 |
@abstractApp 处于前台接收通知时 |
|
225 |
*/ |
537198
|
226 |
+ (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler; |
H |
227 |
|
aea85e
|
228 |
/*! |
H |
229 |
@abstract 通知的点击事件 |
|
230 |
*/ |
537198
|
231 |
+ (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)())completionHandler; |
H |
232 |
|
|
233 |
/*! |
|
234 |
程序进入后台 |
|
235 |
@discussion 处理UIApplicationDelegate的方法[- (void)applicationDidEnterBackground:(UIApplication *)application]传递过来的参数。 |
|
236 |
*/ |
|
237 |
+ (void)applicationDidEnterBackground:(UIApplication *)application; |
|
238 |
|
|
239 |
/*! |
|
240 |
程序将进入前台 |
|
241 |
@discussion 处理UIApplicationDelegate的方法[- (void)applicationWillEnterForeground:(UIApplication *)application]传递过来的参数。 |
|
242 |
*/ |
|
243 |
+ (void)applicationWillEnterForeground:(UIApplication *)application; |
|
244 |
|
|
245 |
/*! |
|
246 |
程序进入前台 |
|
247 |
@discussion 处理UIApplicationDelegate的方法[- (void)applicationDidBecomeActive:(UIApplication *)application]传递过来的参数。 |
|
248 |
*/ |
|
249 |
+ (void)applicationDidBecomeActive:(UIApplication *)application; |
|
250 |
|
|
251 |
/*! |
|
252 |
@discussion 处理UIApplicationDelegate的方法[-(BOOL)application:(UIApplication *)application |
|
253 |
openURL:(NSURL *)url |
|
254 |
sourceApplication:(NSString *)sourceApplication |
|
255 |
annotation:(id)annotation]传递过来的参数。 |
|
256 |
*/ |
|
257 |
+ (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation; |
dcdc07
|
258 |
|
1417b8
|
259 |
+ (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options; |
aea85e
|
260 |
|
H |
261 |
/*! |
|
262 |
@abstract 设备是否越狱 |
|
263 |
*/ |
|
264 |
+ (BOOL)isJailBreak; |
|
265 |
|
dcdc07
|
266 |
@end |