こんにちは私はxamarinアプリにログインしてユーザーを保存しようとしています。ユーザーをxamarinにログインさせ続ける方法
公式のチュートリアルは、ログインしているユーザーを維持する方法でログインしなくする方法について話しています。 Microsoft Tutorial xamarin Tutorial
私の問題は、ログイン方法は、アプリが起動しますどの立ち上げ直されるたびに実行されなければならないということです落ちる前にしばらく空白の画面が表示されます。
ログイン方法
async void Login()
{
if(App.Authenticator != null && authenticated == false)
{
authenticated = await App.Authenticator.Authenticate();
}
}
認証方法
public async Task<bool> Authenticate()
{
var success = false;
var message = string.Empty;
try
{
//Sign in with Active Directory Service
user = await ShopItemManager.DefaultManager.CurrentClient.LoginAsync(this,
MobileServiceAuthenticationProvider.WindowsAzureActiveDirectory);
if (user != null)
{
message = string.Format("You are now signed in as {0}", user.UserId);
success = true;
//store token
}
}
catch (Exception ex)
{
message = ex.Message;
}
//Display the success or failure message
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.SetMessage(message);
builder.SetTitle("Sign-in Result");
builder.Create().Show();
return success;
}
ログインクッキーを設定しようとしましたか? –
私は本当にどのように手掛かりがないだろう。 – xerotolerant
https://developer.xamarin.com/api/property/System.Web.HttpRequest.Cookies/ –