private void ConfigureDataForDistribute(object sender, DistributeTestType distributeTestType) { var prefs = GetSharedPreferences("AppCenter", FileCreationMode.Private); var prefEditor = prefs.Edit(); switch (distributeTestType) { case DistributeTestType.EnableDebuggableBuilds: Distribute.SetEnabledForDebuggableBuild(true); break; case DistributeTestType.FreshInstallAsync: prefEditor.PutString("Distribute.request_id", Config.RequestId); break; case DistributeTestType.CheckUpdateAsync: prefEditor.PutString("Distribute.request_id", Config.RequestId); prefEditor.PutString("Distribute.update_token", "token"); prefEditor.PutString("Distribute.distribution_group_id", Config.DistributionGroupId); prefEditor.PutString("Distribute.downloaded_release_hash", "hash"); break; case DistributeTestType.Clear: prefEditor.Remove("Distribute.request_id"); prefEditor.Remove("Distribute.update_token"); prefEditor.Remove("Distribute.distribution_group_id"); prefEditor.Remove("Distribute.downloaded_release_hash"); break; case DistributeTestType.OnResumeActivity: OnResume(); break; } prefEditor.Commit(); }
private void ConfigureDataForDistribute(object sender, DistributeTestType distributeTestType) { var plist = NSUserDefaults.StandardUserDefaults; switch (distributeTestType) { case DistributeTestType.SaveMockUpdateToken: iOSKeyChainUtil.StoreString(new NSString("xamarinUpdateToken"), new NSString("MSUpdateToken")); break; case DistributeTestType.FreshInstallAsync: plist.SetString("MSDownloadedReleaseId", Config.RequestId); break; case DistributeTestType.CheckUpdateAsync: plist.SetString(Config.RequestId, "MSDownloadedReleaseId"); plist.SetString("token", "MSUpdateTokenRequestId"); plist.SetString(Config.DistributionGroupId, "MSDistributionGroupId"); plist.SetString("hash", "MSDownloadedReleaseHash"); break; case DistributeTestType.Clear: foreach (var i in plist.ToDictionary()) { plist.RemoveObject(i.Key.ToString()); } iOSKeyChainUtil.Clear(); break; case DistributeTestType.OnResumeActivity: WillFinishLaunching(UiApplication, LaunchOptions); break; } }