Inter-app communication

Functions and constants for doing inter-app communication.

These API:s only exist on mobile platforms.

iac.TYPE_INVOCATION

iac type


iac.set_listener()

set iac 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.

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