defold (official)
defold/extension-iac/iac
Functions and constants for doing inter-app communication. Supported on iOS and Android.
- GitHub: defold/extension-iac — pinned to
1.5.0(released while Defold 1.13.1 was current)- Pick a release from defold/extension-iac releases and add its Source code (zip) URL (or a packaged
.zipasset, if the library ships one) togame.projectunder[project]dependencies, then Fetch Libraries in the Defold editor. - Run
bunx @defold-typescript/cli resolveto materialize its types. - Import it under a namespace alias of your choice:
import * as iac from "iac"
- Pick a release from defold/extension-iac releases and add its Source code (zip) URL (or a packaged
Functions
iac.set_listener(payload: table, type: number)
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)
endParameters
payload:table— The iac payload.type:number— The type of iac, an iac.TYPE_ enumeration. It can be one of the predefined constants belowiac.TYPE_INVOCATION
Constants
iac.TYPE_INVOCATION
iac type