fb_auth icon indicating copy to clipboard operation
fb_auth copied to clipboard

Firebase web default initialization through dart code

Open jmolins opened this issue 5 years ago • 3 comments

The plugin configuration includes the firebase configuration for web build right in dart code in the main.dartfile. But this configuration is never used. This PR modifies the web.dart file in the plugin authentication code so the firebase initialization is done through dart code if the <script> item is removed in the index.html. The Readme.md file has been edited to explain this behavior.

jmolins avatar Apr 22 '20 07:04 jmolins

Does this still work for desktop? I guess they recently added firebase_auth for macos because when I created this plugin it was need for the rest api wrapper I built

rodydavis avatar Apr 22 '20 07:04 rodydavis

I haven't tried in desktop. It works in mobile and web.

The change I have done in this PR affects just the web build since I have modified just the web.dart file.

jmolins avatar Apr 22 '20 09:04 jmolins

Hi Rody,

The desktop rest-api still works in macOs.

And the "mobile" version works as well with the new firebase_auth for macos.

I have replaced: static bool get isDesktop => Platform.isWindows || Platform.isLinux || Platform.isMacOS; static bool get isMobile => Platform.isIOS || Platform.isAndroid; with: static bool get isDesktop => Platform.isWindows || Platform.isLinux; static bool get isMobile => Platform.isIOS || Platform.isAndroid || Platform.isMacOS; and it works using the "mobile" FbSdk class.

Maybe some renaming should be performed because with the new firebase_auth the distinction desktop/mobile is no longer true.

Do you want a PR trying the above code change and a rename?

jmolins avatar Apr 24 '20 07:04 jmolins