/// <summary> /// Gets a list of mobile auth provider settings and populates /// </summary> private void GetMobileAuthenticationProviderSettings() { // execute the command var command = new GetMobileServiceSettingsCommand(MobileServiceName, Constants.MobileServicesAuthSettings) { SubscriptionId = SubscriptionId, Certificate = ManagementCertificate }; command.Execute(); // get all the mobile providers returned var mobileProviders = (List<MobileServicesAuthProvider>)JsonConvert.DeserializeObject(command.JsonResult, typeof(List<MobileServicesAuthProvider>)); foreach (var mobileServicesAuthProvider in mobileProviders) { switch (mobileServicesAuthProvider.Provider) { case Constants.GoogleProvider: GoogleClientId = mobileServicesAuthProvider.AppId; GoogleClientSecret = mobileServicesAuthProvider.Secret; break; case Constants.FacebookProvider: FacebookClientId = mobileServicesAuthProvider.AppId; FacebookClientSecret = mobileServicesAuthProvider.Secret; break; case Constants.TwitterProvider: TwitterClientId = mobileServicesAuthProvider.AppId; TwitterClientSecret = mobileServicesAuthProvider.Secret; break; } } }
/// <summary> /// Gets all of the Windows settings for notifications and other things /// </summary> private void GetServiceSettings() { // execute the command var command = new GetMobileServiceSettingsCommand(MobileServiceName, Constants.MobileServicesServiceSettings) { SubscriptionId = SubscriptionId, Certificate = ManagementCertificate }; command.Execute(); // get all the mobile providers returned var settings = (JObject)JsonConvert.DeserializeObject(command.JsonResult); DynamicSchemaEnabled = (bool)settings.GetValue(Constants.DynamicSchemaEnabled).ToObject(typeof(bool)); }
/// <summary> /// Gets all of the Windows settings for notifications and other things /// </summary> private void GetLiveNotificationSettings() { // execute the command var command = new GetMobileServiceSettingsCommand(MobileServiceName, Constants.MobileServicesLiveSettings) { SubscriptionId = SubscriptionId, Certificate = ManagementCertificate }; command.Execute(); // get all the mobile providers returned var windows = (WindowsAuthProvider)JsonConvert.DeserializeObject(command.JsonResult, typeof(WindowsAuthProvider)); MicrosoftAccountClientId = windows.ClientId; MicrosoftAccountClientSecret = windows.ClientSecret; MicrosoftAccountPackageSID = windows.PackageSid; }