推送及房间资源位优化
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
#import <ShareSDK/ShareSDK.h>
|
||||
#import <UserNotifications/UNUserNotificationCenter.h>
|
||||
#import <UserNotifications/UserNotifications.h>
|
||||
|
||||
///Tool
|
||||
#import "YUMIConstant.h"
|
||||
#import "CustomAttachmentDecoder.h"
|
||||
@@ -23,6 +25,8 @@
|
||||
#import "XCCurrentVCStackManager.h"
|
||||
#import "ClientConfig.h"
|
||||
#import <Adjust/Adjust.h>
|
||||
#import <UserNotifications/UserNotifications.h>
|
||||
|
||||
|
||||
#import <Bugly/Bugly.h>
|
||||
|
||||
@@ -44,6 +48,24 @@ UIKIT_EXTERN NSString * adImageName;
|
||||
[self initEmojiData];
|
||||
[self configAdjust];
|
||||
[self configBugly];
|
||||
[self registerNot];
|
||||
}
|
||||
-(void)registerNot{
|
||||
if (@available(iOS 10.0, *)) {
|
||||
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
|
||||
[center requestAuthorizationWithOptions:(UNAuthorizationOptionAlert | UNAuthorizationOptionBadge | UNAuthorizationOptionSound) completionHandler:^(BOOL granted, NSError * _Nullable error) {
|
||||
if (granted) {
|
||||
[center getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) {
|
||||
if (settings.authorizationStatus == UNAuthorizationStatusAuthorized){
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[[UIApplication sharedApplication] registerForRemoteNotifications];
|
||||
});
|
||||
}
|
||||
}];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
崩溃收集 Bugly
|
||||
@@ -73,7 +95,12 @@ UIKIT_EXTERN NSString * adImageName;
|
||||
//推荐在程序启动的时候初始化 NIMSDK
|
||||
NSString *appKey = KeyWithType(KeyType_NetEase);
|
||||
NIMSDKOption *option = [NIMSDKOption optionWithAppKey:appKey];
|
||||
#ifdef DEBUG
|
||||
option.apnsCername = @"pikoDevelopPush";
|
||||
#else
|
||||
option.apnsCername = @"newPiko";
|
||||
#endif
|
||||
|
||||
[[NIMSDK sharedSDK] registerWithOption:option];
|
||||
|
||||
// NIM SDK初始化
|
||||
|
Reference in New Issue
Block a user