GithubHelp home page GithubHelp logo

Comments (10)

masterkain avatar masterkain commented on August 14, 2024

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']
      }
    }

from rapns.

masterkain avatar masterkain commented on August 14, 2024

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

from rapns.

mattconnolly avatar mattconnolly commented on August 14, 2024

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

from rapns.

mattconnolly avatar mattconnolly commented on August 14, 2024

Pull requests always welcome!

from rapns.

masterkain avatar masterkain commented on August 14, 2024

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

from rapns.

masterkain avatar masterkain commented on August 14, 2024

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: https://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/NotificationProgrammingGuideForWebsites/PushNotifications/PushNotifications.html#//apple_ref/doc/uid/TP40013225-CH3-SW1

from rapns.

mattconnolly avatar mattconnolly commented on August 14, 2024

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.

from rapns.

masterkain avatar masterkain commented on August 14, 2024

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.

from rapns.

masterkain avatar masterkain commented on August 14, 2024

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

from rapns.

ileitch avatar ileitch commented on August 14, 2024

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

from rapns.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.