This is a simple Godot Android plugin that allows you to read the view intent URL of the main activity. Useful for e.g. opening deep links in your game.
- Enable Android Custom Build for your project
- Grab and extract the latest binary and plugin config from the releases tab into
res://android/plugins/
- In your Anndroid export settings, make sure the AppLinks plugin is enabled
- Add a new Intent Filter to your
res://android/build/AndroidManifest.xml
, e.g.:<intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="https" android:host="play.doodlepost.net" android:pathPattern="/.*" /> </intent-filter>
Now you can get the Intent URL using the AppLinks
singleton when your game starts:
if Engine.has_singleton('AppLinks'):
var applinks = Engine.get_singleton('AppLinks')
var app_url = applinks.getUrl()
# Do something with app_url...
Also make sure you re-check the Intent URL when your app is resumed. Deep links will not work when the app is already running in the background otherwise.
func _notification(what):
if what == NOTIFICATION_APP_RESUMED:
check_app_link()
- Open this project in Android Studio
- Grab the matching
godot-lib.<version>.<target>.aar
from the Godot Engine downloads page - Add the downloaded
godot-lib.<version>.<target>.aar
as an Android Library, see here - In Android Studio, click Build > Make Project
- Once finished, you'll find the generated
aar
file in./app/build/outputs/aar