I'm going to implement Apple push notifications for my iOS app, and I'd like to do it using an heroku-hosted rails app.
Do you know if this is possible? Or there will be heroku-related problems?
Apple does not offer a way to handle a notification that arrives when your app is closed (i.e. when the user has fully quit the application or the OS had decided to kill it while it is in the background). If this happens, the only way to handle the notification is to wait until it is opened by the user.
Let's start with Android. The Android OS is designed to listen for push messages and upon receiving one, wake up the appropriate Android app to handle the push message, regardless of whether the app is closed or not.
Push notifications do not require any additional app to be functional — the recipient can see the notification even if the app is not running. Almost every app offers an option for push notifications where the user can opt-out or opt-in to receive those notifications.
I have a Rails app serving Apple push notifications just fine. It's been working for a few years now on Heroku without incident.
https://github.com/calebhaye/apn_on_rails
I also have source for mobile clients that I would be happy to share with you, along with the actual source for the APN deployment on Heroku. I would just post a link, but I haven't dug through the source to remove my certs and whatnot.
APN on Rails is a fine solution. UrbanAirship is cool or whatever, but I don't like paying for stuff I can get for free unless and/or until it makes sense. Also, I don't like their lack of support for low cost 'Droid implementations.
Someone said UrbanAirship is cheap... Quite frankly, I disagree. $199/mo (their cheapest "Pro Plan") is not cheap in this day and age. AWS S3, that's cheap. Heroku, that's affordable. UrbanAirship is nice if you can afford it and would rather not implement your own solution. I personally think it was fun, and rather painless. UrbanAirship is good for validating your certs though, sign up for basic account (https://go.urbanairship.com/accounts/register/) and use them for that if you run into problems with regard to certificate validity.
I don't like how UrbanAirship tries to sell you other shit that isn't related to Apple's fundamental push notification service. Subscriptions, fancy-pants push stuff, and enhanced support are all things I can live without. Heroku's support team is great. At any rate, to each their own, but I hope this answer provides some insight.
Good luck, and be well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With