File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,7 +60,6 @@ - (void)registerPush{
6060 UIUserNotificationSettings *userSettings = [UIUserNotificationSettings settingsForTypes: UIUserNotificationTypeBadge|UIUserNotificationTypeSound|UIUserNotificationTypeAlert
6161 categories: [NSSet setWithObject: categorys]];
6262 [[UIApplication sharedApplication ] registerUserNotificationSettings: userSettings];
63- [[UIApplication sharedApplication ] registerForRemoteNotifications ];
6463#endif
6564 }
6665}
@@ -157,7 +156,7 @@ - (void)completionStartAnimationWithOptions:(NSDictionary *)launchOptions{
157156 @weakify (self);
158157 void (^successCallback)(void ) = ^(void ){
159158 // 如果变成需要注册状态
160- if (! [XGPush isUnRegisterStatus ] && [Login isLogin ]){
159+ if ([XGPush isUnRegisterStatus ] && [Login isLogin ]){
161160 @strongify (self);
162161 [self registerPush ];
163162 }
@@ -227,6 +226,15 @@ - (void)application:(UIApplication *)application didReceiveRemoteNotification:(N
227226 [BaseViewController handleNotificationInfo: userInfo applicationState: [application applicationState ]];
228227}
229228
229+ - (void )application : (UIApplication *)application didFailToRegisterForRemoteNotificationsWithError : (NSError *)error {
230+ DebugLog (@" %@ " , error);
231+ }
232+
233+ - (void )application : (UIApplication *)application didRegisterUserNotificationSettings : (UIUserNotificationSettings *)notificationSettings {
234+ DebugLog (@" %@ " , notificationSettings);
235+ [application registerForRemoteNotifications ];
236+ }
237+
230238#pragma mark - Methods Private
231239- (void )setupLoginViewController {
232240 LoginViewController *loginVC = [[LoginViewController alloc ] init ];
You can’t perform that action at this time.
0 commit comments