This extension provides functions for doing inter-app communication. Supported on iOS and Android.
To use this library in your Defold project, add the following URL to your game.project
dependencies:
https://github.com/defold/extension-iac/archive/master.zip
We recommend using a link to a zip file of a specific release.
The source code is available on GitHub
iac
Functions and constants for doing inter-app communication. Supported on iOS and Android. [icon:ios] [icon:android]
iac.TYPE_INVOCATION | iac type |
iac.set_listener() | Sets the listener function for inter-app communication events. |
iac.set_listener(self, payload, type)
Parameter | Type | Description |
---|---|---|
self | object |
The current object. |
payload | table |
The iac payload. |
type | number |
The type of iac, an iac.TYPE_ enumeration. It can be one of the predefined constants below
|
Sets the listener function for inter-app communication events.
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