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

Forge Component
Published on 17 Jan by OutSystems R&D
6 votes
Published on 17 Jan by OutSystems R&D


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.


Magda Pereira

Not sure how to do this. What exactly should be in the "On Destroy" javascript?

I have the NotificationEventsEmitter in my layout block, so now the listeners get registered for every screen I navigate to without ever getting removed.