Hello,


As far as I've seen, I think there is no guide regarding this topic in the forums.

For all the people that are starting developing mobile apps this topic can be interesting to mess with, especially if you are using SDK's to connect to external hardware, want to perform a specific action on a plugin CallBack, want to keep track of the % of your sync and show dynamic changes in the screen without timers, etc


To use events you should keep in mind that you need:

  1. An Event Listener:
    This code creates the event listener, it receives the event outputs and can then call another action to process them, show an alert, etc.
    It should be run in the "OnReady" action of your mobile screen/block.Where:
    -MyEventName is the name you give to the event that identifies their listeners/dispatchers;
    -$actions.ProcessEvent is the action that will process the event return, in this case, it has 2 input parameters;
    -e is the return from the event;
    -e.detail.EventParam1 is one of the return parameters from the event, this will be further explained in the Dispatch Event step;


  2. Event Creation and Dispatch
    This code creates the event and then dispatches it, it should be run when the event happens, for example after the sync of a table, on a javascript callback, etcWhere:
    -MyEventName is the name you give to the event that identifies their listeners/dispatchers;
    -detail: {} is the section where the event outputs are set;
    -EventParam1 is one of the outputs of the event;


Hope this makes some of your developments easier don't hesitate to contact me to clarify any doughts


Best Regards.

Francisco Freire

Hi Francisco,

Thanks for your contribution. Keep sharing those tips.

Regards,

Marcelo

Nice contribution!


Hello Francisco,


Nice topic.


Best regards,

PVN