Skip to content

godot-sdk-integrations/godot-deeplink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

      


Godot Deeplink Plugin

Deeplink plugin provides a unified GDScript interface for processing of App Links on the Android platform and Universal Links on the iOS platform in order to enable direct navigation to specific app content.

Features:

  • Enable web links to directly access app content.
  • Provide support for custom schemes.
  • Check if a domain is associated with app.
  • Forward users to related app settings on platform.

Table of Contents


Installation

Uninstall previous versions before installing. If using both Android & iOS, ensure same addon interface version.

Options:

  1. AssetLib
    • Search for Deeplink
    • Click DownloadInstall
    • Install to project root, Ignore asset root checked
    • Enable via Project → Project Settings → Plugins
    • Ignore file conflict warnings when installing both versions
  2. Manual
    • Download release from GitHub
    • Unzip to project root
    • Enable via Plugins tab

Usage

  • Add Deeplink nodes to your scene per URL association and follow the following steps:

    • set the required field on each Deeplink node
      • scheme
      • host
      • path prefix
    • note that scheme, host, and path prefix must all match for a URI to be processed by the app
      • leave path prefix empty to process all paths in host
  • register a listener for the deeplink_received signal

    • process url, scheme, host, and path data from the signal
  • invoke the initialize() method at startup

  • alternatively, use the following methods to get most recent deeplink data:

    • get_link_url() -> full URL for the deeplink
    • get_link_scheme() -> scheme for the deeplink (ie. 'https')
    • get_link_host() -> host for the deeplink (ie. 'www.example.com')
    • get_link_path() -> path for the deeplink (the part that comes after host)
  • additional methods:

    • is_domain_associated(a_domain: String) -> returns true if your application is correctly associated with the given domain on the tested device
    • navigate_to_open_by_default_settings() -> navigates to the Android OS' Open by Default settings screen for your application

Signals

  • deeplink_received(url: DeeplinkUrl): Emitted when app content is requested via deeplink.

Export

Three options:

  • Add Deeplink node to main scene
  • Open scene with Deeplink nodes in the editor before export
  • Use file-based export
  1. File-based Export Configuration In order to enable file-based export configuration, an export.cfg file should be placed in the addons/DeeplinkPlugin directory. The export.cfg configuration file may contain multiple deeplink configurations. The scheme and host properties are mandatory for each deeplink configuration.

The following is a sample export.cfg file:

[Deeplink1]
scheme = "https"
host = "www.example.com"

[Deeplink2]
scheme = "https"
host = "www.example2.com"

Example export.cfg file with Android-specific properties:

[Deeplink3]
label = "deeplink1"
is_auto_verify = true
is_default = true
is_browsable = true
scheme = "https"
host = "www.example.com"
path_prefix = "/my_data"
  1. Node-based Export Configuration If export.cfg file is not found or file-based configuration fails, then the plugin will attempt to load node-based configuration.

During iOS export, the plugin searches for Deeplink nodes in the scene that is open in the Godot Editor. If none found, then the plugin searches for Deeplink nodes in the project's main scene. Therefore;

  • Make sure that the scene that contains the Deeplink node(s) is selected in the Godot Editor when building and exporting for Android, or
  • Make sure that your Godot project's main scene contains an Deeplink node(s).

Platform-Specific Notes

Android

  • Build: Create custom Android gradle build.
  • Domain Association: Associate Godot app with a domain.
  • Testing:
    1. Use adb shell as follows:
    • $> adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "https://www.example.com/mydata/path"
  • Troubleshooting:
    • Logs: adb logcat | grep 'godot' (Linux), adb.exe logcat | select-string "godot" (Windows)

iOS


Links


All Plugins

Plugin Android iOS
Notification Scheduler
Admob
Deeplink
Share
In-App Review

Credits

Developed by Cengiz

iOS part is based on: Godot iOS Plugin Template

Original repository: Godot Deeplink Plugin


Contributing

This section provides information on how to build the plugin for contributors.


iOS

Prerequisites


Build

  • Run ./script/build.sh -A <godot version> initially to run a full build
  • Run ./script/build.sh -cgA <godot version> to clean, redownload Godot, and rebuild
  • Run ./script/build.sh -ca to clean and build without redownloading Godot
  • Run ./script/build.sh -cb -z4.0 to clean and build plugin without redownloading Godot and package in a zip archive as version 4.0
  • Run ./script/build.sh -h for more information on the build script

Install Script

  • Run ./script/install.sh -t <target directory> -z <path to zip file> install plugin to a Godot project.
  • Example ./script/install.sh -t demo -z build/release/DeeplinkPlugin-v4.0.zip to install to demo app.

Libraries

Library archives will be created in the build/release directory.


Android

Build

Options:

  1. Use Android Studio to build via Build->Assemble Project menu
    • Switch Active Build Variant to release and repeat
    • Run packageDistribution task to create release archive
  2. Use project-root-level build.sh script
    • ./script/build.sh -ca - clean existing build, do a debug build for Android
    • ./script/build.sh -carz - clean existing build, do a release build for Android, and create archive