0 votes

Hello I am a mobile app developer. We had a requirement of sending data from one device to other via bluetooth or wifi without a server. I was able to send data from iOS to iOS. Android to android has been a little tough for me via Bluetooth and tried following code samples from google as well but they restrict the amount of data that I can pass as a string. I think it only passes 24 characters via chat in bluetooth. Transferring from android to iOS and vice versa is an absolute pain. I am not qualified enough to write a C++ implementation for this. Neither I know the internals of Bluetooth or wifi good enough to do this.

I have also used Near by messages api from Google and it is a nightmare to work with as it does not work as expected.

One of my friend suggested to look into how game engines does this. I came across Godot which is open source and extremely lightweight. I am planning to embed Godot Engine in my app just for one or two screens to achieve chat functionality without a server.

I was following this tutorial https://www.youtube.com/watch?v=KspsyDS-jJU and had few questions on this
1. Is this the right way of achieving peer to peer communication in my app without a server if I suck at integrating bluetooth or wifi.
2. Is it possible to embed Godot in android or iOS app. If anyone has docs link for it it would be greatly appreciated. Specifically I am using React native so it will definitely complicate our project but I am happy to give it a try as I do have some knowledge of native mobile app development with kotlin and swift
3. In the above YouTube video what is '' which the YouTuber enters in the app. Is it public ip address. Is it possible to get public ip of my android and iOS device and will they be able to communicate with each other if they are on different ips with the above tutorial?
Sorry I am pretty new to this stuff so some of my questions may sound little dumb.

Godot version 3.4.4
in Engine by (14 points)

Any peer to peer app requires a server. Most kind use a TCP server, others can use FTP or web servers. You can use the python addon for godot and make a python server on replit then use the hacker plan, or uptimerobot, to keep the server running. Or you can create a dedicated server and use only GDScript.

1 Answer

0 votes
  1. Any game engine might be overkill for an embedded chat app. I suggest looking up TCP socket communication. However, if you're set on using Godot for this then RPC based communication (which uses TCP/UDP under the hood) would be a viable choice.

  2. It looks like you might be able to embed/bundle a web export. See react-godot on github.

  3. is known as a loopback address. In this case it's used as an easy way for the computer to refer to itself. For getting the external ip address in Godot see UPNP's query_external_address method.

by (272 points)

I just noticed that there is an open issue in react-godot about missing 3.3.2 support, so getting this project to function with 3.4.x might require some work.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.