add weixinapi

This commit is contained in:
lianxiang
2018-08-27 13:35:39 +08:00
parent a4242fa7b7
commit 6e090fd28d
21 changed files with 325 additions and 58 deletions
+8 -5
View File
@@ -8,6 +8,7 @@
#import "AppDelegate+ThirdParty.h"
#define PUSH_APPKEY @"1f8122badd24c2adb8b3f231"
#import "WXApi.h"
@implementation AppDelegate (ThirdParty)
@@ -37,11 +38,11 @@
//微信
[WXApi registerApp:WXin_APPID];
}
// 微信
#pragma mark 微信
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
return [WXApi handleOpenURL:url delegate:self];
@@ -57,11 +58,14 @@
if ([resp isKindOfClass:[SendAuthResp class]]) {
SendAuthResp*rep = (SendAuthResp*)resp;
if (resp.errCode == 0) {
[[NSNotificationCenter defaultCenter] postNotificationName: @"WXAuthSuccess" object:@{@"code":rep.code}];
NC_POST_NAME_OBJECT(kWeiXinAuthrization_Success, @{@"code":rep.code})
}else{
[[UIApplication sharedApplication].keyWindow makeToast:@"授权失败" duration:1.6 position:CSToastPositionCenter];
}
}
}
#pragma mark - 远程推送
// ios 10 Support
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler API_AVAILABLE(ios(10.0)){
@@ -102,7 +106,6 @@
[UIApplication sharedApplication].applicationIconBadgeNumber = 0;
[JPUSHService resetBadge];
// Required, iOS 7 Support
GILog(@"iOS 7 userInfo%@",userInfo);
[JPUSHService handleRemoteNotification:userInfo];