File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,6 @@ - (void)registerPush{
60
60
UIUserNotificationSettings *userSettings = [UIUserNotificationSettings settingsForTypes: UIUserNotificationTypeBadge|UIUserNotificationTypeSound|UIUserNotificationTypeAlert
61
61
categories: [NSSet setWithObject: categorys]];
62
62
[[UIApplication sharedApplication ] registerUserNotificationSettings: userSettings];
63
- [[UIApplication sharedApplication ] registerForRemoteNotifications ];
64
63
#endif
65
64
}
66
65
}
@@ -157,7 +156,7 @@ - (void)completionStartAnimationWithOptions:(NSDictionary *)launchOptions{
157
156
@weakify (self);
158
157
void (^successCallback)(void ) = ^(void ){
159
158
// 如果变成需要注册状态
160
- if (! [XGPush isUnRegisterStatus ] && [Login isLogin ]){
159
+ if ([XGPush isUnRegisterStatus ] && [Login isLogin ]){
161
160
@strongify (self);
162
161
[self registerPush ];
163
162
}
@@ -227,6 +226,15 @@ - (void)application:(UIApplication *)application didReceiveRemoteNotification:(N
227
226
[BaseViewController handleNotificationInfo: userInfo applicationState: [application applicationState ]];
228
227
}
229
228
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
+
230
238
#pragma mark - Methods Private
231
239
- (void )setupLoginViewController {
232
240
LoginViewController *loginVC = [[LoginViewController alloc ] init ];
You can’t perform that action at this time.
0 commit comments