[Local Notifications Plugin] Invalid call of the 'OnNotificationReceived' client

[Local Notifications Plugin] Invalid call of the 'OnNotificationReceived' client

  
Forge Component
(2)
Published on 2016-12-15 by OutSystems R&D
2 votes
Published on 2016-12-15 by OutSystems R&D

Hi,


We have a native app with multiple pages and LocalNotificationsPlugin\NotificationsEventsEmitter on Common/Layout web block.


However when we change the page there are multiple errors:


Invalid call of the 'OnNotificationReceived' client action of the 'MainFlow.HomePage' since the latter is not currently active. This is likely due to a platform's client action being used as an event handler or in a setTimeout function. Consider removing this call by using the 'On Destroy' event of the screen/block or moving your logic to a global client action.


What is the correct way to setup plugin to catch received and clicked events? Or it is only working for one page apps?




Thank you very much for any information.

Hello Mykola,

In Field Services Mobile application has a similar use case as you're describing. What they did was the first option that you talk about: remove the setTimeout function call by using the 'On Destroy' event on the screen/block. 

You should use the 'On Destroy' where you have the setTimeout function.

Cheers,

Magda Pereira