How do I use SIM Network Provided DateTime?

Hello all,
I am building an app that requires users to log in daily and get rewards - Daily Challenge. I have implemented my logic very well but it is not secure since the user can simply change the DateTime to a future datetime from settings to trick my app. However I discovered I can depend on the network provided time (Automatic Date & Time = Use network provided) so I need a snippet to allow me get the network time always or change the Automatic Date & Time to Use network provided if the user modifies it.

I have tried to change it using this code but to no good.

var timeSettings = Android.Provider.Settings.System.GetString(this.ContentResolver, Android.Provider.Settings.System.AutoTime);
if (timeSettings.Equals("0"))
{
      Android.Provider.Settings.System.PutString(this.ContentResolver, Android.Provider.Settings.System.AutoTime, "1");
}
Sign In or Register to comment.