onMessage
Register the inbound SMS/MMS message handler. The provided function is called for
each messaging.receive event on the subscribed contexts. The function receives a
Message object with message
properties and state tracking.
Only one message handler can be active at a time. Calling onMessage() again
replaces the previous handler.
Parameters
handler
An async function that receives a Message object. Signature:
(message: Message) => void | Promise<void>.
Returns
void