google cloud messaging - How to determine the source of GCM broadcast notification? -
i have existing handling push notification directly sent our backend server. now, want support urban-airship push delivery without breaking existing flow. have defined intentreceiver ua notification (besides existing gcmintentreceiver). problem is, both receivers getting invoked. how can determine , skip particular callback depending upon delivery method used?
the easiest way use 2 different senders. create new sender urban airship , set 'gcmsender', add existing sender 'additionalgcmsenderids' in urban airship config. allow urban airship register both senders application, , ua handle intents form 'gcmsender'. in existing gcm intent receiver need filter out intents urban airship sender id checking "from" on intent.
string sender = intent.getstringextra("from"); if (app_sender.equals(sender)) { // gcm intent existing sender }
Comments
Post a Comment