Skip to content

Fix Remote Config pre-configure access. #9551

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

Merged
merged 2 commits into from
Mar 31, 2022
Merged

Fix Remote Config pre-configure access. #9551

merged 2 commits into from
Mar 31, 2022

Conversation

ryanwilson
Copy link
Member

Currently, when RemoteConfig.remoteConfig() is called before
FirebaseApp.configure() is called, Similar to Database, AppCheck, and
others we'll now throw an ObjC exception. We're not going to make it
nullable or throw a Swift compatible error since it'd affect the
callsite of every usage (either a ? or try) and this is deemed a
programming error: configure() has to be called first.

Fixes #8640

Currently, when `RemoteConfig.remoteConfig()` is called before
`FirebaseApp.configure()` is called, Similar to Database, AppCheck, and
others we'll now throw an ObjC exception. We're not going to make it
nullable or throw a Swift compatible error since it'd affect the
callsite of every usage (either a `?` or `try`) and this is deemed a
programming error: `configure()` has to be called first.

Fixes #8640
@firebase firebase deleted a comment from google-oss-bot Mar 31, 2022
@ryanwilson ryanwilson requested a review from karenyz March 31, 2022 20:16
@ryanwilson ryanwilson added this to the Firebase 9 milestone Mar 31, 2022
[NSException raise:@"FIRAppNotConfigured"
format:@"The default `FirebaseApp` instance must be configured before the "
@"default Remote Config instance can be initialized. One way to ensure this "
@"is to call `FirebaseApp.configure()` in the App Delegate's "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Should AppDelegate be unspaced?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is consistent with the other products, I guess it's a hybrid of Apple's (they have a space but non capitalized, or no space and capitalized) https://developer.apple.com/documentation/uikit/uiapplicationdelegate.

Can change if you feel strongly about it but thought I'd keep it for consistency

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to merge, will follow up on another PR if you think it's worth changing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM - not a strong view and I trust your judgement

@ryanwilson ryanwilson merged commit 500e182 into v9b Mar 31, 2022
@ryanwilson ryanwilson deleted the rw-rc-nullability branch March 31, 2022 20:43
paulb777 pushed a commit that referenced this pull request Apr 4, 2022
* Fix Remote Config pre-configure access.

Currently, when `RemoteConfig.remoteConfig()` is called before
`FirebaseApp.configure()` is called, Similar to Database, AppCheck, and
others we'll now throw an ObjC exception. We're not going to make it
nullable or throw a Swift compatible error since it'd affect the
callsite of every usage (either a `?` or `try`) and this is deemed a
programming error: `configure()` has to be called first.

Fixes #8640

* CHANGELOG
@firebase firebase locked and limited conversation to collaborators May 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants