Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS RemoteConfig - fetchAndActivate doesn't work with setDefaults. #427

Open
NedelcuRadu opened this issue Oct 31, 2023 · 1 comment
Open

Comments

@NedelcuRadu
Copy link

NedelcuRadu commented Oct 31, 2023

Doing this in common code of KMP project:

remoteConfig.setDefaultsSafe(*defaults)
remoteConfig.fetchAndActivate()
log.d { remoteConfig.all }

results in the expected behavior on Android (remote values get fetched and updated), while on iOS they don't (even though the logs say the fetch was successful and values were updated).

Keeping only

remoteConfig.fetchAndActivate()
log.d{ remoteConfig.all }

fixes the issue.

Versions:
Kotlin: 1.9.10
FirebaseConfig: 1.10.0

The shared code is integrated with CocoaPods setup using
pod("FirebaseRemoteConfig", linkOnly = true) that results in

FirebaseRemoteConfig (10.16.0):
    - FirebaseABTesting (~> 10.0)
    - FirebaseCore (~> 10.0)
    - FirebaseInstallations (~> 10.0)
    - GoogleUtilities/Environment (~> 7.8)
    - "GoogleUtilities/NSData+zlib (~> 7.8)"

in Podfile.lock

Logs:

2023-10-30 11:44:57.489729+0200 companion[10413:364098] 10.16.0 - [FirebaseInstallations][I-FIS002000] -[FIRInstallationsIDController createGetInstallationItemPromise], appName: __FIRAPP_DEFAULT
2023-10-30 11:44:57.489862+0200 companion[10413:364098] 10.16.0 - [FirebaseInstallations][I-FIS002001] -[FIRInstallationsIDController installationWithValidAuthTokenForcingRefresh:0], appName: __FIRAPP_DEFAULT
2023-10-30 11:44:57.489932+0200 companion[10413:364098] 10.16.0 - [FirebaseRemoteConfig][I-RCN000022] Success to get iid : fo6jaYdnpEjznkGZHTaURi.
2023-10-30 11:44:57.489960+0200 companion[10413:364098] 10.16.0 - [FirebaseRemoteConfig][I-RCN000060] Fetch with user properties completed.
2023-10-30 11:44:57.489980+0200 companion[10413:364098] 10.16.0 - [FirebaseRemoteConfig][I-RCN000061] Fetch with user properties initiated.
2023-10-30 11:44:57.490152+0200 companion[10413:364098] 10.16.0 - [FirebaseRemoteConfig][I-RCN000040] Start config fetch.
2023-10-30 11:44:57.490177+0200 companion[10413:364098] 10.16.0 - [FirebaseRemoteConfig][I-RCN000061] Making remote config fetch.
2023-10-30 11:44:57.490197+0200 companion[10413:364098] 10.16.0 - [FirebaseRemoteConfig][I-RCN000046] Making config request: https://firebaseremoteconfig.googleapis.com/v1/projects/companion-app-d53f1/namespaces/firebase:fetch?key=...
2023-10-30 11:44:57.849994+0200 companion[10413:364100] 10.16.0 - [FirebaseRemoteConfig][I-RCN000050] config fetch completed. Error: nil StatusCode: 200
2023-10-30 11:44:57.850074+0200 companion[10413:364100] 10.16.0 - [FirebaseRemoteConfig][I-RCN000059] Updating config content from Response for namespace:firebase:__FIRAPP_DEFAULT with state: UPDATE
2023-10-30 11:44:57.850126+0200 companion[10413:364100] 10.16.0 - [FirebaseRemoteConfig][I-RCN000058] Update config in DB for namespace:firebase:__FIRAPP_DEFAULT
2023-10-30 11:44:57.850659+0200 companion[10413:364098] 10.16.0 - [FirebaseRemoteConfig][I-RCN000056] Updating metadata with fetch result.
2023-10-30 11:44:57.851603+0200 companion[10413:364098] 10.16.0 - [FirebaseRemoteConfig][I-RCN000069] Most recently fetched config is already activated.
2023-10-30 11:44:57.851986+0200 companion[10413:364093] D/FeatureConfiguration: Fetched features [(isAccountEnabled, false), (isAppSwitchingEnabled, false), (isCallingEnabled, false), (isScreenSharingEnabled, false), (isTabBarEnabled, false), (isArcControlEnabled, false)]
@NedelcuRadu NedelcuRadu changed the title iOS RemoteConfig - fetchAndActivate doesn't work with defaults. iOS RemoteConfig - fetchAndActivate doesn't work with setDefaults. Oct 31, 2023
@oleksandr-hulak
Copy link

Any feedback on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants