Mobile: Redirect to screen from function()

Mobile: Redirect to screen from function()

  

I would like to know if is possible to pass to another screen from a function in logic or in javascript.


I know that what OS uses is this: 

return OS.Flow.returnAsync(OS.Navigation.navigateTo(OS.Navigation.generateScreenURL("/App/Cards", {}), OS.Transitions.createTransition(OS.Transitions.TransitionAnimation.Default), callContext, true));

And I have a user case where I receive a notification and I need to change to a certain screen with some params like the ID.


Someone could help please?

Thanks in advance,

Miguel Cerejo

Is this JavaScript that's added as a module, or a JavaScript node? If the latter, you can just call a Screen Action that redirects to the other screen?

Kilian Hekhuis wrote:

Is this JavaScript that's added as a module, or a JavaScript node? If the latter, you can just call a Screen Action that redirects to the other screen?

It's a Node, but its on a JS File, so it can't access to the actions of the Platform, because this function is called from the native code of the plugin (this is for the notifications).


The only way I could see now is to return something to the code inside the node, and call from there. But maybe someone else has a better idea.

This would be possible if this function https://success.outsystems.com/Documentation/10/Reference/OutSystems_APIs/JavaScript_API/Navigation#navigateto could be accessed from any JS file or without being on a Node.

Miguel Cerejo wrote:

Kilian Hekhuis wrote:

Is this JavaScript that's added as a module, or a JavaScript node? If the latter, you can just call a Screen Action that redirects to the other screen?

It's a Node, but its on a JS File, so it can't access to the actions of the Platform, because this function is called from the native code of the plugin (this is for the notifications).

Wouldn't it be possible to pass this function as a callback during initial setup of the plugin? That way you could define it from a context where you have access to the OutSystems JavaScript API, and it would still be called from the native plugin code...