I am working on Xamarin forms for our iOS App. I have a requirements to show a dialog box after a certain period of time and show user an option to continue his session or logout.
I am planning to run a timer after user login to the app then check if user already reached certain number of hours. Is there a best way to do the timer? I tried the below method but for some reason it freezes the screen.
Device.StartTimer(new TimeSpan(0, 0, 60), () =>
{
// do something every 60 seconds
Device.BeginInvokeOnMainThread(() =>
{
// interact with UI elements
});
return true; // runs again, or false to stop
});