[OnApplicationResume] Mobile app access control when returning from background

[OnApplicationResume] Mobile app access control when returning from background

  

Hello community,

I'm currently developing a mobile application which has some screens that contain private information, so the access must be restricted. I need to control this access at two levels: when the user is navigating to the screen or if the app is coming from background.

At the screen level, OnInitialize/OnReady/OnRender actions only run if I'm navigating to the screen from another one and not coming from background to foreground.

I have a workaround, using JS OnApplicationResume action, as you can see on the image. However, I want to hear from you if there is another way to achieve this.

PS: That titleOfUserProfile string is the same that I previously defined at the screen on title property.

Thank you,

Ricardo Pedroso. 

Hi Ricardo,

Some notes about that:

  • Why not use the roles to restrict the access to the screens?
  • Also, private data in a mobile device should be kept to the bare minimum. So, if a user has no access to certain information, then that information is not even sent to the device. Thus, it's in the server that you should select the data that must be sent to the device depending on the user that is requesting it. You can use Data Actions to do this.

Does this makes sense in your application?

Cheers,

José