Godot iOS Plugin for Location Service. Retrieve user coordinates and handle client interactions seamlessly. based on Godot Android Plugin Template
. Also see Creating Android plugins
. To download the release, ready to use files go to the Release section
.
- Make sure the addons and ios folder plugins are at
res://addons
andres://ios
. - Go to Project -> Project settings -> Plugins.
- Enable
LocationIOS
plugin. - Go to Project then click Reload Current Project.
- Also enable the plugin from Project -> Export. From options tab Plugins -> Location Plugin
- Now add
LocationIOS
node using the plus add-node button in the scene tab.
Once the LocationIOS
node has been added to the scene. You can:
- reference it from any script and start location service by calling
begin_ios_location_serivce()
method
$LocationIOS.begin_ios_location_serivce()
- Connect to its signals by clicking connect from the Node tab. For example, connecting to location_updated(Latitude:float,Longitude:float) to receive location updates, or from code as follows
$LocationIOS.location_updated.connect(update_pin_position)
-
In order to build the plugin, we need Godot headers. For more details on how to get Godot headers see Godot repo. Place the headers at extracted_headers/godot_4.x. Make sure to follow steps here for more details on how to compile the Godot headers.
-
Run the script below with any Godot 4.X version as an input to produce debug and release plugin(
.xcframework
) files that are compatible with the target Godot version. Example:
./compileLocationPlugin.sh 4.3
This command will produce plugin(.xcframework
) files for Godot 4.3. The result will be at bin/Godot_4.3. To use the plugin, Copy the resulting files and also copy Location.gdip into your Godot project res://ios/plugins/
, copy the addons folder to res://addons
. Don't forget to enable the plugin from project->plugins and from Export settings.