getmovement / deprecated-movement-rails-api

DEPRECATED Rails API for getmovement.org
1 stars 1 forks source link

Push notification system basics #60

Closed begedin closed 8 years ago

begedin commented 8 years ago

Part of a solution for #10, but extremely far from being done

Pushes is shutting down in January. Due to that, I had trouble figuring out what our best approach for implementing push notifications would be.

One option is to host our own Parse server.

Another, which is what I started implementing here, is to use the rpush gem. It's full featured and seems to be popular, but I have little experience with it and in it's default mode (using active record) it's seems to add a good amount of stuff to the app, including 3 tables. I started a very basic implementation of using rpush in our app, but it's mostly contained within the IOSNotifier class, so it should not be a problem to switch to something else.

A third option would be to use OneSignal, with the help of, for example onesignal-ruby. This would give us the web interface and some analytics, but the gems used as wrappers are all relatively unknown and I'm not sure how well they work.

I'm not very familiar with these systems, so I'm hoping someone else might have advice on what we could use.

Ideally, we would want support for iOS and Android notifications (to avoid having to switch to something else in the future), as well as analytics, but I guess analytics aren't a must have here.

joshsmith commented 8 years ago

I would strongly suggest that we not try to host our own solution, even in the case of rpush. I see open issues there around things like silent APNS failures.

Did you look at Batch as a service provider at all? Seems like a good alternative to Parse.

begedin commented 8 years ago

I haven't seen batch yet, but it does look good. However, I'm unable to find a ruby wrapper for it. Googling is an issue due to the name. Did you find anything? Anyone else?

begedin commented 8 years ago

I asked the batch team and they pointed me in the direction of a really simple wrapper for the Batch API. It works with notifications only, but we don't really need anything else.

That being said, though, we may was well want to consider just writing our own. There isn't much to deal with anyway.

https://github.com/nwittstruck/batch

begedin commented 8 years ago

@JoshSmith I switched to using batch as our backend and it was relatively painless. I'm marking this as awaiting review, but keep in mind, this is supposed to be just a basic infrastructure. Before this is merged, I have to ask you to do a couple of things:

  1. Setup a Batch account, with proper iOS certificates, etc
  2. Set the environment variables on CirleCI. I'm currently using variables from my own test account, but It's probably safer for you to handle it, since the same account will end up being used on production.
joshsmith commented 8 years ago

@begedin I've setup the account, generated the certs, and added the environment variables on Circle. We should be good to merge this, although we will want to rerun on Circle before we do.