【发布时间】:2015-01-08 22:39:30
【问题描述】:
所以我正在尝试 Parse.com 推送通知服务。
我已完成所有步骤等,当我尝试在模拟器上运行时,应用程序运行,但当我尝试在我的 Iphone 设备(Iphone 5s)上运行它时,应用程序崩溃并出现以下错误代码:
015-01-08 17:28:45.607 PickMeUp[451:60b] -[UIApplication registerForRemoteNotifications]:
unrecognized selector sent to instance 0x1576016f0
2015-01-08 17:28:45.610 PickMeUp[451:60b] *** Terminating app
due to uncaught exception 'NSInvalidArgumentException', reason:
'-[UIApplication registerForRemoteNotifications]: unrecognized selector sent to instance 0x1576016f0'
这是代码
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[Parse setApplicationId:@""];
// Register for Push Notitications
UIUserNotificationType userNotificationTypes = (UIUserNotificationTypeAlert |
UIUserNotificationTypeBadge |
UIUserNotificationTypeSound);
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:userNotificationTypes
categories:nil];
[application registerUserNotificationSettings:settings]; // The app crashes here
[application registerForRemoteNotifications];
return YES;
}
编辑
我的 iphone 没有完全更新。版本是 7.1
【问题讨论】:
标签: ios iphone parse-platform push-notification