Skip to content

Re-enable ios constructors #379

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 3 commits into from
Jun 10, 2023
Merged

Re-enable ios constructors #379

merged 3 commits into from
Jun 10, 2023

Conversation

walkingbrad
Copy link
Contributor

@walkingbrad walkingbrad commented May 22, 2023

#349 commented out these constructors due to compilation issues. I think things are compiling fine now, for whatever reason, so I'm just uncommenting them back. Looks like there's just some build-time confusion about FirebaseApp types that a force-cast alleviates. Thanks @Daeda88!

Note: fun useFunctionsEmulator(origin: String) has been removed as it is no longer present in the latest Firebase version that this repo is now pointing to (it used to be deprecated).

@walkingbrad
Copy link
Contributor Author

Welp compilation issues do still exist. I'll keep investigating.

@walkingbrad
Copy link
Contributor Author

walkingbrad commented May 22, 2023

Error:

Type mismatch: inferred type is cocoapods.FirebaseCore.FIRApp but objcnames.classes.FIRApp was expected

Looks related to https://youtrack.jetbrains.com/issue/KT-56468

@Daeda88
Copy link
Contributor

Daeda88 commented May 23, 2023

Error:

Type mismatch: inferred type is cocoapods.FirebaseCore.FIRApp but objcnames.classes.FIRApp was expected

Looks related to https://youtrack.jetbrains.com/issue/KT-56468

Its essentially a type alias, so you should be able to just cast. You'll get a warning that casting cannot succeed because the project cannot properly resolve the objcnames.classes package, but Ive tested on my own fork and there it works just fine

@walkingbrad
Copy link
Contributor Author

Looks to be working in my local setup as well! Thanks @Daeda88, I probably never would have tried this.

I am successfully publishing this lib to mavenLocal and running my iOS app that depends on a few of these iOS constructor APIs to load a dynamic FirebaseApp at runtime

I've tested these at runtime, and all the others should work too since the logic I introduced is the same:

  • cloud functions
  • firestore
  • auth

Copy link
Member

@nbransby nbransby left a comment

Choose a reason for hiding this comment

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

Great stuff, thanks both!

@nbransby nbransby merged commit ce594e4 into GitLiveApp:master Jun 10, 2023
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

Successfully merging this pull request may close these issues.

3 participants