Screen navigation

  

I have a screen with a Switch widget. When I change the state of the Switch it takes me to the device's local Setting's screen to turn ON/OFF location sharing.

For instance assume that initially the Switch was in OFF state and when user changes it 's state, it will redirect user to settings screen where they may turn ON the location sharing. But what if user changed mind and I don't make any changes in the settings screen and go back to the app. The state of Switch will be ON no matter what changes user made in the settings screen since user changed its state.

I don't want this to happen. Instead when user goes back to the screen the state of the switch should be in its original state.

Could anyone please help me.


Perhaps you can use this plugin? https://www.outsystems.com/forge/component/1395/location-plugin/ (if not already using)

To see if the user has location tracking on/working and base the state of the switch toggle on that?

Claring wrote:

Perhaps you can use this plugin? https://www.outsystems.com/forge/component/1395/location-plugin/ (if not already using)

To see if the user has location tracking on/working and base the state of the switch toggle on that?

Yeah, I have already written a logic to check if location tracking is ON/OFF. I need to know how do I trigger this event when Settings page resumed back from Settings page.

Does Outsystems provide a way to get the onResume() event on a particular screen as we have it in native Android implementation.


Hi Shreyas,

The OnApplicationResume event does not trigger automatically?

https://success.outsystems.com/Documentation/10/Reference/Platform_Utilities/System_Events/Mobile/On_Application_Resume

You can add logic to it and it will trigger when your application comes back from back.

Would this be useful in your case?

Cheers.

It will not be triggered on a specific screen thou. It is generic. It will trigger everytime your application resumes.

Eduardo Jauch wrote:

Hi Shreyas,

The OnApplicationResume event does not trigger automatically?

https://success.outsystems.com/Documentation/10/Reference/Platform_Utilities/System_Events/Mobile/On_Application_Resume

You can add logic to it and it will trigger when your application comes back from back.

Would this be useful in your case?

Cheers.

It will not be triggered on a specific screen thou. It is generic. It will trigger everytime your application resumes.

Well, I have not tried it. Let me check and get back to you.


Shreyas Bhondve wrote:

Eduardo Jauch wrote:

Hi Shreyas,

The OnApplicationResume event does not trigger automatically?

https://success.outsystems.com/Documentation/10/Reference/Platform_Utilities/System_Events/Mobile/On_Application_Resume

You can add logic to it and it will trigger when your application comes back from back.

Would this be useful in your case?

Cheers.

It will not be triggered on a specific screen thou. It is generic. It will trigger everytime your application resumes.

Well, I have not tried it. Let me check and get back to you.


Hey Eduardo,

I believe the OnApplicationResume event is at application level and not at particular instance on screen level. In case if I trigger the location tracking event in OnApplicationResume, how will I have access the variable that are used at the screen level which manages the state of the Switch?


Yes, it is an application event.

One way to solve this is to use a Local Entity to store the value of this variable, mimicking Session Variables.
You could write to local storage in the screen and read the value from it in the event.

Maybe you can use this approach?

Cheers.

Eduardo Jauch