独立WatchOS6应用程序的APNS失败 [英] Failing APNS for Independent WatchOS6 app

查看:95
本文介绍了独立WatchOS6应用程序的APNS失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

设置新的独立WatchOS6应用程序后,该应用程序现在支持推送通知,让设备请求用户发出推送通知并捕获推送令牌.我无法让服务器发送推送通知.

After setting up a new independent WatchOS6 app, which now supports push notifications, getting the device to request the user for push notifications and capturing the push token. I can’t get my server to send a push notification.

在NodeJS服务器上设置了所有正确的凭据和P8之后,我试图将消息推送到设备上……这始终是错误:

With all the correct credentials and P8 set up on my NodeJS server, I have tried to push messages to the device... This is the error all the time:

状态400 - DeviceTokenNotForTopic -根据Apple的文档,这表示主题(应用的BundleId)是错误的.但是在这种情况下不是.

Status 400 - DeviceTokenNotForTopic - Which according to Apple’s documentation, means that the Topic (BundleId of the app) is wrong. But in this case it is not.

尝试了2种不同的NPM软件包(用于淘汰)

Tried 2 different NPM packages (for elimination)

https://www.npmjs.com/package/node-pushnotifications

https://www.npmjs.com/package/apn

两者都给我带来了同样的问题.

Both providing me with the same issue.

有人成功地完成了带有APN的Independent WatchOS应用程序的开发吗?我想念什么

Has anyone successfully managed to complete a Independent WatchOS app with APNs? What am I missing

———

更新

要测试节点服务,还进行了2个测试:

To test the node service, a further 2 tests have been made:

  1. 这次使用相同的Bundle Identifier在iOS中创建了一个新应用,该应用使用pushToken并发送一条消息,说明该服务成功

使用不同的捆绑包标识符创建了一个新的应用程序,另一个watchOS,再次被拒绝,但是同一 DeviceTokenNotForTopic 问题的APN.

Created a new app, another watchOS, with a different Bundle Identifier, this was again rejected but the APNs for the same DeviceTokenNotForTopic issue.

要测试生产,当前的唯一方法是提交给商店以供App Store审核.WatchF目前无法使用TestFlight选项,并且无法手动安装生产临时 .ipa .进入商店后,我将继续进行进一步的测试.

To test production, the only way current is to submit to the store for App Store review. TestFlight option is currently not available for the Watch and there is no way to install a production ad-hoc .ipa manually. Once it is in the store I will continue with further tests.

推荐答案

问题已解决.

Xcode有两个问题,如果您依靠Xcode在开发人员门户中对证书进行分类,那么请不要.

Xcode has a couple of issues, if you rely on Xcode to sort out your certificates in the developer portal then please don't.

我一直在与支持部门联系,几天后来回记录日志后,我意识到:

I have been in touch with support and after a few days back and forth with logs it has been made aware that:

  1. Apple关于Independent WatchOS应用程序的文档没有声明任何地方,其中 topic (捆绑销售商品ID)应为以 .watchkitapp结尾的那个strong>
  2. Xcode不允许您将推送通知功能添加到 .watchkitapp ,因此这意味着它永远不会在开发人员门户中创建AppId.
  1. Apple's documentation for Independent WatchOS applications does not state anywhere that the topic (which is the bundle id) should be the one ending in .watchkitapp
  2. Xcode does not allow you to add the Push Notification Capability to the .watchkitapp thus meaning it never creates the AppId in your developer portal.

我遇到的问题的解决方案是手动转到开发人员门户并添加 .watchkitapp AppId并创建证书,从而允许服务器上的我的p8证书允许推送到那个特定的应用程序.

The solution to the problem, I had, was to manually go to the developer portal and add the .watchkitapp AppId and create the certificates, thus allowing my p8 certificate on the server to allow pushes to that particular application.

这篇关于独立WatchOS6应用程序的APNS失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆