Exemple #1
0
 public NSString CreateLogin(NSString nothing)
 {
     KeychainHelpers.SetPasswordForUsername("admin", "password", "XamarinExpenses", Security.SecAccessible.Always, true);
     NSUserDefaults.StandardUserDefaults.SetString("admin", "username");
     NSUserDefaults.StandardUserDefaults.Synchronize();
     return(new NSString());
 }
Exemple #2
0
        public async Task <bool> SetPasswordForUsername(string username, string password)
        {
            if (String.IsNullOrEmpty(username) || String.IsNullOrEmpty(password))
            {
                return(false);
            }

            KeychainHelpers.SetPasswordForUsername(username, password, "XamarinExpenses", Security.SecAccessible.Always, true);
            NSUserDefaults.StandardUserDefaults.SetString(username, "username");
            NSUserDefaults.StandardUserDefaults.SetBool(true, "hasLogin");
            NSUserDefaults.StandardUserDefaults.Synchronize();

            return(true);
        }