Skip to content

Pass default topic to push notification api #5

Open

Description

@mayank-singh

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

Activity

  1. ostinelli commented on May 6, 2016

    @ostinelli
    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?

  2. mayank-singh commented on May 7, 2016

    @mayank-singh
    Author

    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

  3. mat commented on Sep 28, 2016

    @mat

    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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions