Giter Site home page Giter Site logo

Comments (2)

froodian avatar froodian commented on June 27, 2024 1

I would say the JWT path is strictly better. The major functional difference is that p12s expire and need to be regenerated every year, and doing so generally requires using Apple's OS X Keychain utility, or using openssl directly. Cryptographically they're both considered secure. The JWT option is more recent, having been introduced by Apple several years into APNs' lifetime, and so probably has more lifetime in front of it as well.

(disclaimer: I cannot represent sideshow or apple - I'm just a rando who watches this repository, and this has just been my experience)

from apns2.

sideshow avatar sideshow commented on June 27, 2024

Heres how Apple explains:

Tokens

Token-based authentication offers a stateless way to communicate with APNs. Stateless communication is faster than certificate-based communication because it doesn’t require APNs to look up the certificate, or other information, related to your provider server. There are other advantages to using token-based authentication:

  • You can use the same token from multiple provider servers.
  • You can use one token to distribute notifications for all of your company’s apps.

Certificates

Because trust is established at the server-level, individual notification requests contain only your payload and a device token. They don't include an authentication token, which reduces the size of each notification request slightly.

Note that Apple stop short of suggesting which one to use but I agree with @froodian that tokens are generally superior, and you should use them if possible. Certs were the original way to authenticate before Apple bought in token based auth. As @froodian said, certs expire every year which can be annoying. You also have to make sure they are created for the right app and the right push environment (development vs sandbox), and you have to make sure you export them correctly and they are in the right format. Basically tokens are way simpler and less work.

from apns2.

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.