这是我可 *** 作通知的设置
Nsstring * const NotificationcategoryIDent = @"ACTIONABLE";Nsstring * const NotificationActionOneIDent = @"ACTION_ONE";Nsstring * const NotificationActionTwoIDent = @"ACTION_TWO";-(UIMutableUserNotificationcategory*)registeractions { UIMutableUserNotificationAction *action1; action1 = [[UIMutableUserNotificationAction alloc] init]; [action1 setActivationMode:UIUserNotificationActivationModeBackground]; [action1 setTitle:@"Open"]; [action1 setIDentifIEr:NotificationActionOneIDent]; [action1 setDestructive:NO]; [action1 setAuthenticationrequired:NO]; UIMutableUserNotificationAction *action2; action2 = [[UIMutableUserNotificationAction alloc] init]; [action2 setActivationMode:UIUserNotificationActivationModeBackground]; [action2 setTitle:@"Delete"]; [action2 setIDentifIEr:NotificationActionTwoIDent]; [action2 setDestructive:NO]; [action2 setAuthenticationrequired:NO]; UIMutableUserNotificationcategory *actioncategory; actioncategory = [[UIMutableUserNotificationcategory alloc] init]; [actioncategory setIDentifIEr:NotificationcategoryIDent]; [actioncategory setActions:@[action1,action2] forContext:UIUserNotificationActionContextDefault]; NSSet *categorIEs = [NSSet setWithObject:actioncategory]; UIUserNotificationType types = (UIUserNotificationTypeAlert| UIUserNotificationTypeSound| UIUserNotificationTypeBadge); UIUserNotificationSettings *settings; settings = [UIUserNotificationSettings settingsForTypes:types categorIEs:categorIEs]; [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; return actioncategory; }
什么可能是确切的问题?有人可以帮助我..提前谢谢.
解决方法[action1 setActivationMode:UIUserNotificationActivationModeBackground];
应该:
[action1 setActivationMode:UIUserNotificationActivationModeForeground];
这是按下按钮后启动应用程序的原因.
总结以上是内存溢出为你收集整理的xcode – iOS8中无法打开应用程序的可 *** 作通知全部内容,希望文章能够帮你解决xcode – iOS8中无法打开应用程序的可 *** 作通知所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)