FORUMS
Remove All Ads from XDA

[APP][2.2+][UPDATED 08/23/12] SnapNotify - Roll Your Own Custom Cloud Notifications

37 posts
Thanks Meter: 26
 
By sagarkar, Member on 21st August 2012, 05:59 AM
Post Reply Email Thread
SnapNotify – Roll Your Own Custom Cloud Notifications
What’s the point?
SnapNotify makes getting cloud-based android notifications as easy as posting to a webserver – and the entire system (including running your own server) is free!

How does it work?
SnapNotify consists of a lightweight server (powered by node.js, which you can run for free on heroku) and an android app that handles receiving notifications. It allows you to push custom notifications to all of your mobile devices, without having to learn Google Cloud Messaging or having to write your own android app.

Sample use:
Code:
$ curl -d "Test Message,SnapNotify works. yay : )" "http://YOURSERVER/message"
Produces a notification on all of your devices that looks like this:


Some Simple Use Cases:
1) A simple web scraper / monitor
- Write a script that loads a page, checks content, and notifies you upon changes
- Offloads the heavy lifting to your server

2) Server tasks
- Just tag a POST onto the end of your management scripts to be notified when time-consuming events complete

Basically, the idea is to make it easy to incorporate GCM messages / notifications into hacks that don't need an independent and full-fledged Android App.

Installation / Setup:
I've written a full setup guide with download links and source on my website, which you can find here:
http://sagark.org/snapnotify-roll-yo...notifications/

Post here if you have ideas for improvement / find it useful / etc.
The Following 16 Users Say Thank You to sagarkar For This Useful Post: [ View ] Gift sagarkar Ad-Free
 
 
21st August 2012, 03:46 PM |#3  
Junior Member
Flag Fargo, ND
Thanks Meter: 5
 
More
Thumbs up
Just set this up on my Galaxy Nexus by following the Heroku guide. It works great! Thanks a bunch
21st August 2012, 09:38 PM |#4  
Junior Member
Flag Fargo, ND
Thanks Meter: 5
 
More
Sorry for the double post, but quick question: If I already have a domain name and stuff, is there a way that I can point it to the heroku server so that I don't have to remember the long subdomain? Thanks
21st August 2012, 11:59 PM |#5  
OP Member
Thanks Meter: 26
 
More
Quote:
Originally Posted by woot_galaxy_nexus

Sorry for the double post, but quick question: If I already have a domain name and stuff, is there a way that I can point it to the heroku server so that I don't have to remember the long subdomain? Thanks

Yep, Heroku supports this functionality. You can follow the guide at the top of this page and then setup a CNAME in your DNS:
https://devcenter.heroku.com/articles/custom-domains
The Following User Says Thank You to sagarkar For This Useful Post: [ View ] Gift sagarkar Ad-Free
22nd August 2012, 01:46 AM |#6  
Junior Member
Flag Fargo, ND
Thanks Meter: 5
 
More
Quote:
Originally Posted by sagarkar

Yep, Heroku supports this functionality. You can follow the guide at the top of this page and then setup a CNAME in your DNS:
https://devcenter.heroku.com/articles/custom-domains

Thanks it worked
23rd August 2012, 12:19 AM |#7  
psouza4's Avatar
Inactive Recognized Developer
Flag Meridian, ID
Thanks Meter: 826
 
Donate to Me
More
Looks good so far... but you knew this question would come up:

How do we customize notifications (different icons, different sounds, launch a custom intent on click -- maybe encoded in the notification itself, etc.)? Do you have something coming to the APK and/or source code for it?

Thanks!
23rd August 2012, 12:54 AM |#8  
Account currently disabled
Thanks Meter: 268
 
More
Awesome post!
23rd August 2012, 05:54 AM |#9  
OP Member
Thanks Meter: 26
 
More
Quote:
Originally Posted by psouza4

Looks good so far... but you knew this question would come up:

How do we customize notifications (different icons, different sounds, launch a custom intent on click -- maybe encoded in the notification itself, etc.)? Do you have something coming to the APK and/or source code for it?

Thanks!

Yep, this'll probably come as something encoded in the POST + predefined settings (key, values) in the app. Unfortunately, school starts tomorrow so I don't have a ton of time on my hands anymore

I'll try to get it done soon though.
The Following 2 Users Say Thank You to sagarkar For This Useful Post: [ View ] Gift sagarkar Ad-Free
23rd August 2012, 08:35 PM |#10  
OP Member
Thanks Meter: 26
 
More
Update Aug 23, 2012:
For those of you running on heroku, snapnotify-server now posts to itself every 20 minutes to prevent idling. Idling wouldn't be a problem by itself, but heroku provides a read-only fs (thus no storing to registration_store), so you'd need to re-register after every recovery from idle. Preventing the idling seems to be the simplest solution at this point. After updating, everything should work as expected. Nothing should change for anyone running on their own server.

Upgrade paths:
1) Running on heroku:
Server: Obtain the new files, change settings in snapserver.settings, git add -u, git commit -m 'update', git push heroku master
App: No need to update

2) Your own server:
Server: Stop Node.js, obtain new files, change settings in snapserver.settings (notably, change the new heroku attribute to false), restart Node.js
App: No need to update
The Following User Says Thank You to sagarkar For This Useful Post: [ View ] Gift sagarkar Ad-Free
23rd August 2012, 10:31 PM |#11  
psouza4's Avatar
Inactive Recognized Developer
Flag Meridian, ID
Thanks Meter: 826
 
Donate to Me
More
Wound up writing my own app and ditching node.js for something that'll run on a traditional webserver. I'm not that patient and wanted to customize a bunch of stuff. Thanks for the great idea/work so far!
Post Reply Subscribe to Thread

Tags
cloud messaging, gcm, node.js, notifications, webserver

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes