- Select ref document -

Inter-app communication API documentation

version 1.2.149

Functions and constants for doing inter-app communication.

These API:s only exist on mobile platforms.

Functions

iac.set_listener

iac.set_listener(listener)

Sets the listener function for inter-app communication events.

Parameters

listener

function(self, payload, type) listener callback function. Pass an empty function if you no longer wish to receive callbacks.

self

object The current object.

payload

table The iac payload.

type

constant The type of iac, an iac.TYPE_ enumeration.

listener

function(self, payload, type) listener callback function. Pass an empty function if you no longer wish to receive callbacks.

self

object The current object.

payload

table The iac payload.

type

constant The type of iac, an iac.TYPE_ enumeration.

Examples

Set the iac listener.

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

local init(self)
     ...
     iac.set_listener(iac_listener)
end

Constants

iac.TYPE_INVOCATION