Search code examples
androidtitaniumpubnub

pubnub push notification titanium android


I using pubnub chat for android using titanium appcelerator platform, I had just crossed about the push notification to android via pubnub , It provides its own development kit for the chat clients but i tried to use it for android, I couldn't there is existing sample for ios but not for android actually. Anybody had crossed this issue...let me know how to use this.

Pub nub help link for push notification....


Solution

  • Actually it is pretty simple as i thought to create a pubnub notification. We have to simply run background service and in that do the following steps.,

    • Add background service using this BOOT_COMPLETED Titanium module ,
    • Before suscribe a new channel inside the background service code. (for eg.: MY_notify_channel),
    • Next go to your chat screen , Next to the line that you are publishing to your private dynamic channel, Publish once again to our MY_notify_channel .

    • That's it when ever you publishing you get a message received in your service box, you have segregate your message in that and then create a notification manually. Titanium.Android.Notification link