- Home /
Send messages to friends ?
Hi everybody ! I just want to know if it's possible to send messages to friends (or contacts, ...) in Unity ? Or create an application (android, ios,...) for this ? Thank you, bye xyHeat
You need to elaborate.
$$anonymous$$essages through the editor? What?
Do you mean in game using UNet?
Sorry,I mean : Is it possible to player who downloaded the game to send messages to an other user (like his friend), with UNet or without it...
The answer should be in here (for UNet)
http://docs.unity3d.com/$$anonymous$$anual/UNet$$anonymous$$essages.html
http://docs.unity3d.com/ScriptReference/Networking.Network$$anonymous$$essage.html
to manipulate Custom messaging to send, say, a String across the network.
This should probably be implemented in its own low priority channel.
Answer by P3JX · Apr 16, 2016 at 12:19 PM
You can use HTTP post / get request to send message and in friends end read what you send though JSON.
Required:
Internet or intranet connection (both your friend and you have to connect)
You need small web server with basic script running to process the data.
how to send HTTP request well answered in this question
And how to Read JSON data from a server in here
My be there is a cheaper/better solution involve with unity networking. this is what i can think of
No Problem. There may be a solution with unity networking also, found this network view. But if you just want to send / receive data i think simpler to stick with get/post requests.
NetworkView is the Legacy system. Doesn't work in UNet. Also I think its like using isLocalPlayer etc to identify who is who.
agreed with @meat500. if program only needs to broadcast message to all players this could be easily done using isLocalPlayer, SyncVar etc i guess. and i think it is possible to send messages to specific device also.
Thank you, (again !), So if i understand, i can send message to an android(for exemple) device with HTTP post / get and a JSON file or with unity networking ?
I've been meaning to try it for a while now. As I'm making a multiplayer game I may just return with a solution. No guarantees! ;)