Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass default topic to push notification api #5

Open
mayank-singh opened this issue May 6, 2016 · 3 comments
Open

Pass default topic to push notification api #5

mayank-singh opened this issue May 6, 2016 · 3 comments

Comments

@mayank-singh
Copy link

Push notification api requires topic to be passed with the request. Can we pass default topic for notifications?

@ostinelli
Copy link
Owner

This is not my understanding from what I read in the docs:

The topic of the remote notification, which is typically the bundle ID for your app. The certificate you create in Member Center 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 header and your APNs certificate does not specify multiple topics, the APNs server uses the certificate’s Subject as the default topic.

So, the topic is only needed if the certificate includes multiple topics.

That being said, how do you suggest that you pass in a default topic for notifications?

@mayank-singh
Copy link
Author

mayank-singh commented May 7, 2016

You are correct. In my case, Certificate had more than one topic.
If we can either set config for Apnotic for default topic using mattr_accessor and then use it when building headers for request or we can fetch topic for certificate like the following implementation.(1st one will be easier to implement)
https://github.com/alloy/lowdown/blob/master/lib/lowdown/certificate.rb

@mat
Copy link

mat commented Sep 28, 2016

I think it makes sense to add an optional topic to Connection while keeping the per-notification override in place.

That should make it a bit more usable for people who only need to send pushes to one topic but need to specify it because the cert contains more than one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants