Skip to Content
defold-typescript libraries
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)
    1. Pick a release from defold/extension-iac releases and add its Source code (zip) URL (or a packaged .zip asset, if the library ships one) to game.project under [project] dependencies, then Fetch Libraries in the Defold editor.
    2. Run bunx @defold-typescript/cli resolve to materialize its types.
    3. Import it under a namespace alias of your choice:
      import * as iac from "iac"

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)
  end

Parameters

  • payload: table — The iac payload.
  • type: number — The type of iac, an iac.TYPE_ enumeration. It can be one of the predefined constants below
    • iac.TYPE_INVOCATION

Constants

iac.TYPE_INVOCATION

iac type

On this page