i just want to hear how others would do this. i have that has chat functionality, i want to track the online and offline status of the user. So my thinking is to do it the following way
1) a a Field in the users table that stores online status
2) When the user start the app , i will update the online status on the user to online
3) when the app goes on sleep i update it back to offline
protected override void OnSleep()
4) When it resumes again update it to online
protected override void OnResume()
5) When the app is closing also on this solution https://forums.xamarin.com/discussion/171037/how-to-run-an-event-when-the-app-is-closed
set the status to offline.
Is this the right way ?