Auto Logout & Available Space on Device

Vikas85Vikas85 USMember ✭✭
edited August 2016 in Xamarin.Forms

Guys,
Kindly guide me below functionality:-

  1. I want to logout , if the app is ideal i.e if no activity performed in particular time span, the app automatically log out.
  2. Want to check available space on Device.

I am working on app which is support to both iOS /Android.

Answers

  • GeraldVersluisGeraldVersluis NLUniversity ✭✭✭✭

    For option 1, you should probably look at the events in you App.cs, OnStart, OnSuspended, etc.
    There set the DateTime of when the app is going to the background, and check the new DateTime when the app is being started again. If the difference in time is beyond the limit you want it to be, log out the user.
    Since you cannot have (this kind of code) run in the background, you can't have the user log out automatically, so 'fake' it like this.

    For the disk space part, you're going to have to create some platform specific code for it. There are some posts on this if you look for it. Android, another Android, iOS

  • Vikas85Vikas85 USMember ✭✭

    Does any1 provide me sample of code for both, as i am struggling between iOS and Android funtionality

    @GeraldVersluis ,
    About available space , I will sure look into it.
    But do you any piece of code for 1 Query.

Sign In or Register to comment.