Skip to content

Adding a new push notification

Jacob Ferrero edited this page Oct 19, 2015 · 2 revisions
Android
  1. Add another PUSH_ACTION_* to Config.java
  2. Add another case to the switch in Push::got that handles to notification
  • If your push should load more data or perform an action, also add it to the second switch
  1. You're done with Android
Backend
  1. Add another PUSH_ACTION_* to Config.java
  2. Add two methods to the type class in the thing package
  • toPushJson(Document thing) which should create the entire push object
    • This should include the action key which is whatever you added in Config.java)
  • makePush(Document thing) which creates a JSON object representation of your thing condensed for push messages
  1. In the api endpoint (or whatever should trigger the push), call Push.getService()::send* using your new methods on the thing class

Clone this wiki locally