private static void Init() { if (Account == null) { if (AccountStore == null) { AccountStore = Xamarin.Auth.AccountStore.Create(); } if (AccountStore == null) { throw new Exception("Account Store not Supported"); } try { Account = AccountStore.FindAccountsForService(APP_NAME_KEY).FirstOrDefault(); } catch { Account = null; } if (Account == null) { Account = new Xamarin.Auth.Account { Username = USERNAME_FOR_SS }; AccountStore.Save(Account, APP_NAME_KEY); } } }
public void Save(Account account, string serviceId) { xAccountStore.Save((Xamarin.Auth.Account)account.xAccount, serviceId); }