Skip to content


Trying Rapns with Safari Push #185

masterkain opened this Issue · 10 comments

3 participants


I implemented packaging, signing and callbacks functionality in my web app to enable Safari Push notification, now it's time to start testing if the whole thing works with rapns, however the tokens released by Safari are not compatible with the ones that currently rapns accepts on notifications.

Do you think it's possible for rapns to support Safari Push notification and if yes are you interested in pull requests?


Everything appears to be working, it's just the token validation that needs fixing, and mention that perhaps Safari Push message can be sent only in production (as per Apple guidelines).

To send an acceptable payload:

    notification.attributes_for_device = {
      aps: {
        alert: {
          title: title,
          body: body,
          action: 'View'
        'url-args' => ['boarding']

still checking, will do a pull request with further findings.

@masterkain masterkain closed this

I haven't looked into Safari web push yet. What do the tokens look like that they fail?


Pull requests always welcome!


I got tokens back such as 078069A9EE1522D7C05DB462936D20E6E450ED7DE1A79FCFDE671CE3020688D3, which are same length but the regex /^[a-z0-9]{64}$/i does not match them.


two other things:

  • as per the spec "url-args": ["boarding", "A998"] seems optional, while it is really not.
  • the spec is unclear on the token format, maybe you have better luck

spec is here:


The token you have there matches the regex you have (not looking at code yet). I think the regex should be /^[0-9a-f]{64}$/i though.


you're right, I forgot the /i in the tests I made, however I have a validation exception while trying to send notification with the safari push token, digging further.


ok, it works without modification, it must have been something else that got in the way.
nothing to do :+1:


I'd love to see a Wiki page for Safari Push ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.