Skip to content

Comments

Expose Firebase App and Firestore database to public#3

Open
ibilux wants to merge 6 commits intoProteanSoftware:mainfrom
ibilux:main
Open

Expose Firebase App and Firestore database to public#3
ibilux wants to merge 6 commits intoProteanSoftware:mainfrom
ibilux:main

Conversation

@ibilux
Copy link
Contributor

@ibilux ibilux commented Oct 13, 2022

The Firebase App and Firestore database are/maybe needed for some other work.
It's better to expose Firebase App and Firestore database to public.

@AshleyMedway
Copy link
Contributor

This will work fine for the web implementation but the Android and iOS implementations will return JSON objects that match the serializable properties of the Swift/Java objects. What's the extra work that is needed? Probably we should add more methods to the implementation?

@ibilux
Copy link
Contributor Author

ibilux commented Oct 13, 2022

The Firebase App and Firestore database are need for the Firebase packages (like auth).
So it's better to expose them as public.
I used the JSON objects as return for Android and iOS implementations, because i thought this package used JSON objects as a return as a common rule.
If the JSON objects is not needed as a return type, it should be removed.

@AshleyMedway
Copy link
Contributor

What I mean is that the App and Firestore are classes. i.e. Firestore is often cast to FirebaseAppImpl within the firebase codeset. So you wouldn't be able to pass the firestore returned from Android/iOS into another call?

@ibilux
Copy link
Contributor Author

ibilux commented Oct 13, 2022

@AshleyMedway The Capacitor Android Plugin Guide indicate that the resolve() method of PluginCall takes a JSObject and supports JSON-serializable data types.
So this mean it can return a FirebaseAppImpl or any other object type,
But you are right this doesn't mean it will work.
If it didn't work we will need to implement something like @capacitor-firebase/app.

@AshleyMedway
Copy link
Contributor

AshleyMedway commented Oct 13, 2022

Yeah I think how they’ve done it might be the way, return the config and create the same objects in the web, however, the general idea for this plugin is to remove the need for the web versions all together due to their flaky-ness particularly on iOS

Ashley Medway added 3 commits February 16, 2023 09:59
(cherry picked from commit d4eb157)

# Conflicts:
#	ios/Plugin/CapacitorFirestore.swift
(cherry picked from commit 22b08c7)
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.

2 participants