Skip to main content

bn.handleCrossAppMessage

handleCrossAppMessage(action, callback): void

description Used for handle cross mini-app communication. A same action name can only be registered once. Otherwise, the later one will be ignored.

remark supported jssdk > 4.26.0

example

bn.handleCrossAppMessage('action', (options) => {
console.log(options)
return { code: 0 }
})

bn.handleCrossAppMessage('wrong-action', (options) => {
throw { code: 1, message: 'error' }
})

Parameters

NameType
actionstring
callback(options: undefined | Record<string, any>) => any

Returns

void