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