strongloop/loopback-component-push

Support APNS new HTTP/2 JWT Model

Closed this issue · 11 comments

Hello

As you know, apple introduced a new way of sending push notifications. The old method of creating those annoying certificates for each app is gone.

The thing now is, that the underlaying node-apn Framework which is used by the loopback push component supports those.

One problem rightnow is, that this component does not make it possible to specify the .topic-Property of the APN-Notification object. This is required, so that the iOS system knows to which app the notification goes.

So, here at this point in the component, there should be a possibility to set the topic-Property.

Do you want to submit a patch?

I'll see tomorrow whether I can submit anything.

hi @raymondfeng
It seems that there are more changes nessecary, I forked the branch and started to work on it, is there any way I contact you about this issue with further details? (Skype, etc)

@ir-tech Having the conversation here is preferred. Thanks for taking it up!

@raymondfeng The changes work more or less right now, but there is one problem:
node-apn ditched the feedback-service because the new HTTP/2-Approach retrieves immediate feedback (like GCM). I hooked the "devicesGone"-Events onto the response of the request, but the old way with plain TLS-Certificates won't work anymore.

So, with a new release of this component, the user would be forced to use the new approach with the JWT-Tokens instead of the old (soon to be deprecated) TLS-approach.

Is that acceptable?

Great job. I was also going to look at this soon.

Maybe releasing with a major version bump would make it acceptable.

The new apns is supposed to also get rid of #123 - Which is a bonus.

Yes, we can release a new major version

I started working on the issue and have some code ready on this fork: https://github.com/ir-tech/loopback-component-push

What I did is

  • ditch the whole feedback service
  • ditch (almost) the whole certificate relevant service
  • implemented the connection through the new apn provider-object
  • implemented the "devicesGone"-functionality with the new apple feedback system
  • following the fellow boyscout rule, refactored and commented some stuff in the apns part.

What is left to do on this particular thing is:

  • Modify the unit tests according to the changes (sorry it would have been better if I would have sticked to the principels of TDD and modify them first. Next time, I promise!)
  • Make sure there is not a new connection each time there are notifications sent (this is an issue with node-apn, investigating rightnow)
  • Enhance the documentation, there are new configurations required now (token, teamId, bundle identifier)

@raymondfeng
I have submitted the Pull Request 11 days ago, but nothing happened there.
Is any additional work nessecary from my side, or why is there no progress?