Login during splashscreen with Xamarin iOS/Android using MvvmCross -
when xamarin app starts, try automatically login user based on stored credentials.
the login works, during startup splash-screen disappears second or 2 showing black screen.
when disable auto-login feature, splash-screen smoothly transfers next view.
here code:
public async void start(object hint = null) { _securestorageservice = mvx.resolve<isecurestorageservice>(); clearparametercacheuponstart(); setpushtokenrequirement(); var loginservice = mvx.resolve<iloginservice>(); var stopwatch = stopwatch.startnew(); debug.writeline("start loginservice"); if (hasusernameandpassword() && await loginservice.tryloginwithstoredcredentials()) { showviewmodel<dashboardviewmodel>(); } else { showviewmodel<loginviewmodel>(true); } stopwatch.stop(); debug.writeline("finished loginservice: {0}ms", stopwatch.elapsedmilliseconds); }
is right place login user? or there better solutions xamarin-mvvmcross project.
thanks in advance.
Comments
Post a Comment