[LYN-4915] [iOS] [Android] awscoreconfiguration.setreg, awsMetricsClientConfigurationsetreg and authenticationProvider.setreg couldn't be loaded when the application starts (#1716)

[LYN-4915] [iOS] [Android] awscoreconfiguration.setreg, awsMetricsClientConfiguration.setreg and authenticationProvider.setreg couldn't be loaded when the application starts
This commit is contained in:
Junbo Liang
2021-07-02 11:12:45 -07:00
committed by GitHub
parent dfef909b51
commit 9f2b31e077
35 changed files with 3943 additions and 3999 deletions
@@ -30,9 +30,16 @@ namespace AWSClientAuth
m_settings.reset();
}
bool GoogleAuthenticationProvider::Initialize(AZStd::weak_ptr<AZ::SettingsRegistryInterface> settingsRegistry)
bool GoogleAuthenticationProvider::Initialize()
{
if (!settingsRegistry.lock()->GetObject(m_settings.get(), azrtti_typeid(m_settings.get()), GoogleSettingsPath))
AZ::SettingsRegistryInterface* settingsRegistry = AZ::SettingsRegistry::Get();
if (!settingsRegistry)
{
AZ_Warning("AWSCognitoAuthenticationProvider", false, "Failed to load the setting registry");
return false;
}
if (!settingsRegistry->GetObject(m_settings.get(), azrtti_typeid(m_settings.get()), GoogleSettingsPath))
{
AZ_Warning("AWSCognitoAuthenticationProvider", false, "Failed to get Google settings object for path %s", GoogleSettingsPath);
return false;