Explorar el Código

Added IAC manual

Björn Ritzl hace 6 años
padre
commit
39cc31f106
Se han modificado 2 ficheros con 48 adiciones y 0 borrados
  1. 4 0
      docs/en/en.json
  2. 44 0
      docs/en/manuals/iac.md

+ 4 - 0
docs/en/en.json

@@ -495,6 +495,10 @@
                         "path": "/manuals/iap",
                         "name": "In-app purchases"
                     },
+                    {
+                        "path": "/manuals/iac",
+                        "name": "Inter-app communication"
+                    },
                     {
                         "path": "/manuals/push",
                         "name": "Push notifications"

+ 44 - 0
docs/en/manuals/iac.md

@@ -0,0 +1,44 @@
+---
+title: Inter-app communication in Defold
+brief: Inter-app communication allows you to pick up on the launch arguments used when starting your application. This manual explains Defold's API available for this functionality.
+---
+
+# Inter-app communication
+
+Applications can on most operating systems be launched in several ways:
+
+* From the list of installed applications
+* From an application specific link
+* From a push notification
+* As the final step of an installation process.
+
+In the case when the application is launched from a link, notification or when installed it is possible to pass additional arguments such as an install referrer when installing or a deep-link when launching from an application specific link or notification. Defold provides a unified way to get the information about how the application was invoked using a native extensions.
+
+## Installing the extension
+
+To start using the Inter-app communication extension you need to add it as a dependency to your `game.project` file. The latest stable version is available with the dependency URL:
+```
+https://github.com/defold/extension-iac/archive/master.zip
+```
+
+We recommend using a link to a zip file of a [specific release](https://github.com/defold/extension-iac/releases).
+
+## Using the extension
+
+The API is very easy to use. You provide the extension with a listener function and react to listener callbacks.
+
+```
+local function iac_listener(self, payload, type)
+     if type == iac.TYPE_INVOCATION then
+         -- This was an invocation
+         print(payload.origin) -- origin may be empty string if it could not be resolved
+         print(payload.url)
+     end
+end
+
+function init(self)
+     iac.set_listener(iac_listener)
+end
+```
+
+Full documentation of the API is available on the [extension GitHub page](https://defold.github.io/extension-iac/).