java - GCM device to device messaging - how is it done? -


i'm interested in how apps whatsapp implement feature. i've read it's bad practice send message directly device device, because can api key , send messages application.

what's solution then? having server , making devices communicate server, when want send message device, goes server , server target device?

also question:

 public void onmessagereceived(string from, bundle data) 

this method of gcmlistenerservice. when "from" different default senderid? because tried sending message directly 1 device , "from" still default senderid got when registered app on website.

basically, need server listen upstream messages , broadcast again intended recipients.

you can find article describing here: http://javapapers.com/android/android-chat-with-google-gcm-xmpp/

the approach pretty limited , not flexible having own messaging server, should enough proof of concept.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

wso2esb - How to concatenate JSON array values in WSO2 ESB? -