Tutorial: interop.registerIntentHandler

interop.registerIntentHandler

Adds an intent handler for incoming intents. The last intent sent of the name subscribed to will be received.

Example

const intentHandler = (intent) => {
    const { context } = intent;
    myViewChartHandler(context);
};

const subscription = await fin.me.interop.registerIntentHandler(intentHandler, 'ViewChart');

function myAppCloseSequence() {
    // to unsubscribe the handler, simply call:
    subscription.unsubscribe();
}