首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Apple - Provisioning profile +推送通知

Apple - Provisioning profile +推送通知
EN

Stack Overflow用户
提问于 2014-10-06 23:49:40
回答 1查看 126关注 0票数 0

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

我使用几个Xcode和parse应用程序从头开始尝试了几次,请帮助我。

Appdelegate代码:

代码语言:javascript
复制
 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)
    }
EN

回答 1

Stack Overflow用户

发布于 2014-10-30 20:41:28

您是否已将设备添加到Development Provisioning配置文件中,然后进行下载和安装?在添加设备之前,我得到了相同的错误。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26219984

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档