WatchOS6 Independent APNs DeviceTokenNotForTopic

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.


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:


Status 400 -

DeviceTokenNotForTopic
- Which according to Apple’s documentation, means that the Topic (Bundle Identifier of the app) is wrong. But in this case it is not. I have tried tht the main Bundle Identifier, the .watchkitapp Identifier and the watchkitapp.extension Identifier


How do I successfully send a push to a Independent WatchOS app with APNs?


———


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

  1. Created a new app, iOS this time, with the same Bundle Identifier, using the pushToken and sending a message the service was successful
  2. Created a new app, another watchOS, with a different Bundle Identifier, this was again rejected but the APNs for the same
    DeviceTokenNotForTopic
    issue.


Tested both in production and sandbox with the same issues.

Replies

Updated to watchOS6.1 this morning and still having the same issues. Token is provided by the device but it is still passing `DeviceTokenNotForTopic` error when trying to send a push notification.


Would be great to be put in touch with an engineer.

I've been trying the exact same thing, and get the same results. I'm on Catalina GM with XCode 11, WatchOS 6.01.

I'm using the token from "didUpdate pushCredentials" in my push message. I checked the HTTP/2 headers for apns-push-type complication . I tried all bundle ID's, with and without .complication suffix.

I'm using the key method, not the certificate method. With my key I am able to push remote notifications to my IPhone.

Not sure what I am missing here.

I have the exact same issue!

I seem to have gotten a bit further. I was reading about someone having the same problems, but with regular remote notifications directly to watch. The issue was that you need to send the push to com.example.appname.watchkitapp, but you cannot add the push notification ability to that target. XCode does not create specific identifiers and profiles for the watchkitapp target (see your developer account information on developer.apple.com)


So I created two identifiers for my test app, for .watchkitapp and for the main bundle identifier (so com.example.appname), with push notification enabled. Also created profiles for both targets. Then disabled automatic signing for these targets, and imported these profiles for those targets. The watchkit.extension target I left on auto.


Seemed to not do anything at first, but after a while I was able to send a com.example.appname.watchkitapp.complication (topic) push without getting DeviceTokenNotForTopic. Maybe it takes a while for the profiles and identifiers to become active? Mind you, I've never done any manual profile configuring, so just trying here.


Anyway, no error, but also no didReceiveIncomingPushWith being called, so it's not completely working. I'm using a token that was given by didUpdate pushCredentials on tests days ago. Because, I'm not getting any token information anymore. Might be where it's gone wrong. didUpdate pushCredentials is never called. Not sure how to reset the PKPushKit token, if possible at all.


Anyway, thought I'd put the info here, so you can try. Interested in the results.

I am also facing same issue. Are you able to fix this?

I got complication pushes working in an independent WatchOS 6 app. The extra steps I took, using PushApp as an example application name:


  • Created identifier with explicit bundle id com.example.PushApp.watchkitapp and push notifications enabled (on developer.apple.com using your developer account)
  • Using that identifier, created a related profile PushApp watchkitapp

The above steps are necessary to get rid of "device token not for topic" error. I did not use this profile explicitly for signing the project, I left it on automatic

  • Added Background Modes -> Remote notification capability to the PushApp WatchKit Extension target in the XCode project
  • Added Push Notifications capability to the PushApp WatchKit Extension target

And finally:

In the info.plist for the SmaHomi WatchKit Extension, add "App provides Voice over IP services" to the "Required background modes".

Without this I was unable to get a PushKit token. Which is strange in my opinion.


Now I am able to send complication pushes with apns-topic com.example.PushApp.watchkitapp.complication and apns-push-type complication. I also set priority to 5 and content available to 1.


Update: Note that you can get error 410 unregistered when sending complicaton pushes. This can happen when the complication of your app is not active on the current watch face.

Well I found the solution my manually entering my .watchapp bundle ID target in my developer portal. Xcode did add bundle ID of my .watchextension but did not add the .watchapp one. so I had to add manually, that did the work for me.