我在本教程中做了所有事情:
http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12
我创建了证书、app_id 和配置文件,并尝试在委托文件中使用带有简单代码的推送通知服务:
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
// Let the device know we want to receive push notifications
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
我在 iPad 上尝试了我的应用程序,但它不起作用。iOS 不会询问我是否允许我的应用使用推送通知,也不会在“设置”>“通知”列表中显示我的应用。我在编译或运行我的应用程序时没有收到错误..
错误
我刚刚实现了“didFailToRegisterForRemoteNotificationsWithError”方法,运行应用程序时出现此错误
2013-03-31 00:11:10.481 PushAppCalisma [272:907] {
NSLocalizedDescription = "no valid 'aps-environment' entitlement string found for application";
}