本文介绍了CloudKit +没有有效的APS-环境权利的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用 CloudKit 订阅在我的应用程序,但 didReceiveRemoteNotification 拿不到触发。

I try to use CloudKit subscriptions in my app, but didReceiveRemoteNotification not get triggered.

我救了 CKSubscription CloudKit 。为了确保他们的存在,应用程序启动时,我绘制出来,如:

I saved CKSubscription to CloudKit. To be sure they exists, when app starts, I plot them out, like:

< CKSubscription:0x15576310; ;查询订阅:RECORDTYPE = DailyVote,predicate = TRUE preDICATE,subscriptionOptions = 7,subscriptionID = 1FA456A6-9BA5-411D-97B9-1EB57121A5D0,=了zoneid(空)GT; predicate:TRUE preDICATE subscriptionType:(枚举值)subscriptionOptions:C.CKSubscriptionOptions

我尝试注册我的APN服务器设备,如苹果DOC 建议,但错误的委托方法被调用,具有消息:

I try to register my device at APN server, as apple doc recommend, but error delegate method get called, with message:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

    application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: .Alert, categories: nil))
    application.registerForRemoteNotifications()

    return true
}

func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError) {

    println("error: \(error.localizedDescription)")
    //error: no valid aps-environment entitlement found for application
}


  • CloudKit 能力上

  • 我没有无效条款简介

  • 我做的伎俩: X code > preferences > 帐户> 选择您的账户> 拿起你的团队> 查看详情> $ p $干燥综合征刷新按钮

  • 我甚至创造了一个新的应用,新的iCloud集装箱,感动了所有的逻辑,但错误是相同的订阅通知不起作用。

    • CloudKit capability is on
    • I have no invalid provision profile
    • I have done the trick: Xcode > Preferences > Accounts > pick your Account > pick your Team > View Details > PRESS REFRESH BUTTON
    • I even created a fresh App, with new iCloud Container, moved all the logic, but the error is the same and subscription notification does not work.
    • 推荐答案

      尽管苹果医生说这里:您不需要启用应用程序的明确的App ID在会员中心推送通知接收订阅通知。 X $ C $Ç自动添加的APN有权您的授权文件,当您启用CloudKit。

      如果您添加推送通知 它会工作,或者至少为第二次尝试对我来说它的工作。

      If you add Push Notification in Developer Portal under App IDs it will work, or at least for second try for me it worked.

      这篇关于CloudKit +没有有效的APS-环境权利的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 15:30