DeviceTokenNotForTopic ?

1,804 views
Skip to first unread message

Matthias Wessendorf

unread,
Apr 18, 2017, 3:15:22 PM4/18/17
to pushy
Hi,

I read the default topic from the given .p12 file, and when sending (PROD), I am always getting 

"DeviceTokenNotForTopic"

sending w/ "null" topic seems to only work on DEVELOPMENT, hrm...

--

Jon Chambers

unread,
Apr 18, 2017, 5:50:25 PM4/18/17
to Matthias Wessendorf, pushy
Hrm indeed. Generally, when the APNs development/production servers disagree, it's an upstream bug. I'd say it's worth filing a bug report. Oddly, bug reports about discrepancies between the two environments seem to get resolved more quickly than other APNs bug reports.

Hope that helps!

-Jon

--
Pushy is an open-source Java library for sending APNs (iOS and OS X) push notifications. Pushy is brought to you by the engineers at RelayRides.
---
You received this message because you are subscribed to the Google Groups "pushy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pushy-apns+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matthias Wessendorf

unread,
Apr 18, 2017, 7:07:19 PM4/18/17
to Jon Chambers, pushy
On Tue, Apr 18, 2017 at 11:50 PM, Jon Chambers <j...@turo.com> wrote:
Hrm indeed. Generally, when the APNs development/production servers disagree, it's an upstream bug.

you mean the "null" topic? Or what ? 

 
I'd say it's worth filing a bug report. Oddly, bug reports about discrepancies between the two environments seem to get resolved more quickly than other APNs bug reports.

bug report against APNs is done where? (never filed a ticket against APNs)

Jon Chambers

unread,
Apr 19, 2017, 10:54:27 AM4/19/17
to Matthias Wessendorf, pushy
So to take a step back, here's what the APNs have to say about the `apns-topic` field of the payload:

> The topic of the remote notification, which is typically the bundle ID for your app. The certificate you create in your developer account must include the capability for this topic.
> If your certificate includes multiple topics, you must specify a value for this header.
> If you omit this request header and your APNs certificate does not specify multiple topics, the APNs server uses the certificate’s Subject as the default topic.
> If you are using a provider token instead of a certificate, you must specify a value for this request header. The topic you provide should be provisioned for the your team named in your developer account.

So the docs, at least, claim that both environments *should* allow you to skip the topic if you have a single-topic certificate. If the production environment isn't doing that, it sounds like a bug. For future reference, you can report bugs at https://bugreport.apple.com/.

Hope that helps!

-Jon

Jon Chambers

unread,
Apr 19, 2017, 11:00:34 AM4/19/17
to Matthias Wessendorf, pushy
Waaaaaait a second. It doesn't look like you can even get single-topic certificates for production any more; weirdly enough, it looks like you can still get single-topic certificates, but only for the sandbox environments. All of the certificates you can get for production are both multi-topic and multi-environment (i.e. valid for both sandbox/production).

This leads to two things: First, Matthias, you may have a sandbox-only certificate, but I'm surprised you'd be able to connect to production at all if that were the case. Stranger things have happened, though.

Second, I think it's probably time to deprecate the "topic can be null" behavior in Pushy, and we should *always* require a topic because all production certificates are multi-topic (and token-based authentication is inherently multi-topic). Any objections?

-Jon

Matthias Wessendorf

unread,
Apr 19, 2017, 11:08:15 AM4/19/17
to Jon Chambers, pushy
On Wed, 19 Apr 2017 at 17:00, Jon Chambers <j...@turo.com> wrote:
Waaaaaait a second. It doesn't look like you can even get single-topic certificates for production any more; weirdly enough, it looks like you can still get single-topic certificates, but only for the sandbox environments. All of the certificates you can get for production are both multi-topic and multi-environment (i.e. valid for both sandbox/production).

I have multi env cert, but it's for one app/bundle ID, no?


This leads to two things: First, Matthias, you may have a sandbox-only certificate, but I'm surprised you'd be able to connect to production at all if that were the case. Stranger things have happened, though.

Second, I think it's probably time to deprecate the "topic can be null" behavior in Pushy, and we should *always* require a topic because all production certificates are multi-topic (and token-based authentication is inherently multi-topic). Any objections?

sounds good w/ me to deprecate.


I real subject/bundle ID from .p12 file now... 




-Jon

 

Hope that helps!

-Jon

To unsubscribe from this group and stop receiving emails from it, send an email to pushy-apns+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
Pushy is an open-source Java library for sending APNs (iOS and OS X) push notifications. Pushy is brought to you by the engineers at RelayRides.
---
You received this message because you are subscribed to the Google Groups "pushy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pushy-apns+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
Pushy is an open-source Java library for sending APNs (iOS and OS X) push notifications. Pushy is brought to you by the engineers at RelayRides.
---
You received this message because you are subscribed to the Google Groups "pushy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pushy-apns+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
Sent from Gmail Mobile

Jon Chambers

unread,
Apr 19, 2017, 5:10:20 PM4/19/17
to Matthias Wessendorf, pushy
On Wed, Apr 19, 2017 at 11:08 AM, Matthias Wessendorf <mat...@apache.org> wrote:

I have multi env cert, but it's for one app/bundle ID, no?

Ah—yes, but each app/bundle actually has three topics in the certificate (if it's issued recently, at least):

- com.example.MyApp
- com.example.MyApp.voip
- com.example.MyApp.complication

So if that's the case for your certificate, you'll need to specify a topic. I'd actually say it's a bug that the development server *isn't* complaining that a topic is missing.

Hope that helps!

-Jon
Reply all
Reply to author
Forward
0 new messages