mirror of
https://github.com/bitwarden/mobile
synced 2026-01-01 16:13:15 +00:00
support for appconfig settings (#727)
This commit is contained in:
@@ -282,7 +282,7 @@ namespace Bit.iOS
|
||||
_nfcDelegate = new NFCReaderDelegate((success, message) =>
|
||||
_messagingService.Send("gotYubiKeyOTP", message));
|
||||
|
||||
iOSCoreHelpers.Bootstrap();
|
||||
iOSCoreHelpers.Bootstrap(async () => await ApplyManagedSettingsAsync());
|
||||
}
|
||||
|
||||
private void RegisterPush()
|
||||
@@ -475,5 +475,20 @@ namespace Bit.iOS
|
||||
UIApplication.SharedApplication.EndBackgroundTask(_eventBackgroundTaskId);
|
||||
_eventBackgroundTaskId = 0;
|
||||
}
|
||||
|
||||
private async Task ApplyManagedSettingsAsync()
|
||||
{
|
||||
var userDefaults = NSUserDefaults.StandardUserDefaults;
|
||||
var managedSettings = userDefaults.DictionaryForKey("com.apple.configuration.managed");
|
||||
if(managedSettings != null && managedSettings.Count > 0)
|
||||
{
|
||||
var dict = new Dictionary<string, string>();
|
||||
foreach(var setting in managedSettings)
|
||||
{
|
||||
dict.Add(setting.Key.ToString(), setting.Value?.ToString());
|
||||
}
|
||||
await AppHelpers.SetPreconfiguredSettingsAsync(dict);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user