我遵循了Parse.com上的指南,了解如何创建证书并准备一个配置帐户来接受推送通知。当我转到Preferences/Accounts :它显示在底部,但当我试图从Build Settings选项卡中选择它时,它没有显示,并且我总是得到这样的错误:"no valid 'aps-environment' entitlement string found for application"

我使用几个Xcode和parse应用程序从头开始尝试了几次,请帮助我。
Appdelegate代码:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
Parse.setApplicationId("MyAppId", clientKey: "MyAppClientKey")
var notificationType: UIUserNotificationType = UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound
var settings: UIUserNotificationSettings = UIUserNotificationSettings(forTypes: notificationType, categories: nil)
UIApplication.sharedApplication().registerUserNotificationSettings(settings)
UIApplication.sharedApplication().registerForRemoteNotifications()
return true
}
func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
var currentInstallation: PFInstallation = PFInstallation()
currentInstallation.setDeviceTokenFromData(deviceToken)
currentInstallation.saveInBackground()
}
func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError) {
println(error.localizedDescription)
}
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) {
PFPush.handlePush(userInfo)
}发布于 2014-10-30 20:41:28
您是否已将设备添加到Development Provisioning配置文件中,然后进行下载和安装?在添加设备之前,我得到了相同的错误。
https://stackoverflow.com/questions/26219984
复制相似问题