reallysmallsoftware / cordova-plugin-firebaseui-auth Goto Github PK
View Code? Open in Web Editor NEWCordova plugin to provide FirebaseUI Authentication
License: Apache License 2.0
Cordova plugin to provide FirebaseUI Authentication
License: Apache License 2.0
Is there currently a way to silently sign the user in if they sign before? Pretty much the only way to do it at the moment is to call the login function which works after the first login, but not the first login as it interrupts the user.
Thanks for this - this seems to be the only Cordova extension that actually implements the real native Firebase SDK.
Sorry for the noobie question. I'm very advanced at JS and Firebase, but never created an Android or Cordova app before.
Your readme has a radically different JS implementation of firebaseui:
// i require this kind of browser implementation:
FirebaseUIAuth.initialise({
"providers": ["GOOGLE", "FACEBOOK", "EMAIL", "ANONYMOUS"],
"tosUrl" : "http://www.myapp.co.uk/terms.html",
"privacyPolicyUrl" : "http://www.myapp.co.uk/privacy.html",
"theme" : "themeName",
"logo" : "logoName",
"uiElement" : "mywebelement",
"anonymous" : true|false,
"smartLockEnabled" : true|false,
"smartLockHints" : true|false,
"browser" : {
apiKey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
authDomain: 'xxxxxxxxxxxxxx.firebaseapp.com',
projectId: 'xxxxxxxxxxxxx',
}
}).then(function(firebaseUIAuth) {
myfirebaseUIAuthInstance = firebaseUIAuth;
});
But it is so different from the existing firebaseui, that I'm not sure where to begin.
If you could provide help on what this FirebaseUIAuth
object is and where it comes from, that would be great!
Here is my current firebaseui implementation. Should I adjust this in any way?
const config = {
signInSuccessUrl: '/',
signInOptions: [
firebase.auth.GoogleAuthProvider.PROVIDER_ID,
],
credentialHelper: firebaseui.auth.CredentialHelper.NONE,
// Terms of service url.
tosUrl: 'https://cine-match.com/tos',
privacyPolicy: 'https://cine-match.com/tos'
}
export default {
mounted () {
this.startUi()
},
methods:
{
startUi () {
// Initialize the FirebaseUI Widget using Firebase.
let ui = firebaseui.auth.AuthUI.getInstance()
if (!ui) {
ui = new firebaseui.auth.AuthUI(firebase.auth())
}
console.log('isPendingRedirect() → ', ui.isPendingRedirect())
// The start method will wait until the DOM is loaded.
// if (ui.isPendingRedirect()) {
// ui.start('#firebaseui-auth-container', config);
// }
const el = document.getElementById('firebaseui-auth-container')
if (!el) return
ui.start('#firebaseui-auth-container', config)
},
please add more information how to use it, i got difficulties use it on my quasar cordova project
Plugin should install without a problem using [email protected] as a Cordova platform.
$ cordova plugin add cordova-plugin-firebaseui-auth --variable ANDROID_FIREBASE_CORE_VERSION=16.0.0 --variable ANDROID_FIREBASE_AUTH_VERSION=16.0.1 --variable ANDROID_PLAY_SERVICES_AUTH_VERSION=15.0.1 --variable ANDROID_FIREBASEUI_VERSION=3.3.1 --variable ANDROID_FACEBOOK_SDK_VERSION=4.31.0 --variable FACEBOOK_APPLICATION_ID=12345678 --variable FACEBOOK_DISPLAY_NAME="My application" --variable REVERSED_CLIENT_ID="com.googleusercontent.apps.9999999999-xxxxxxxxxxxxxxxxxxxxxxxxxx" --variable COLOR_PRIMARY="#ffffff" --variable COLOR_DARK_PRIMARY="#555555" --variable COLOR_LIGHT_PRIMARY="#aaaaaa" --variable COLOR_ACCENT="#7C4DFF" --variable COLOR_SECONDARY="#FFC107" --variable COLOR_CONTROL="#ffffff" --variable COLOR_BACKGROUND="#000000"
Installing "cordova-plugin-firebaseui-auth" for ios
Installing "cordova-plugin-android-fragmentactivity" for ios
"framework" tag with type "podspec" is deprecated and will be removed. Please use the "podspec" tag.
Running command: pod install --verbose
Failed to install 'cordova-plugin-firebaseui-auth': Error: pod: Command failed with exit code 1
at ChildProcess.whenDone (/Users/rohantalip/dev/cordova-test/hello/node_modules/cordova-common/src/superspawn.js:125:23)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:962:16)
at Socket.stream.socket.on (internal/child_process.js:381:11)
at Socket.emit (events.js:182:13)
at Pipe._handle.close (net.js:610:12)
pod: Command failed with exit code 1
$ mkdir cordova-test
$ cordova create hello com.example.hello HelloWorld
$ cd hello
Installation succeeds with version 4.5.4 of the iOS platform:
$ cordova platform add ios
Using cordova-fetch for cordova-ios@~4.5.4
Adding ios project...
Creating Cordova project for the iOS platform:
Path: platforms/ios
Package: com.example.hello
Name: HelloWorld
iOS project created with [email protected]
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for ios
Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
--save flag or autosave detected
Saving ios@~4.5.5 into config.xml file ...
An Android-specific plugin is also installed along with some detached HEAD git messages, but at least the plugin is installed:
$ cordova plugin add cordova-plugin-firebaseui-auth --variable ANDROID_FIREBASE_CORE_VERSION=16.0.0 --variable ANDROID_FIREBASE_AUTH_VERSION=16.0.1 --variable ANDROID_PLAY_SERVICES_AUTH_VERSION=15.0.1 --variable ANDROID_FIREBASEUI_VERSION=3.3.1 --variable ANDROID_FACEBOOK_SDK_VERSION=4.31.0 --variable FACEBOOK_APPLICATION_ID=12345678 --variable FACEBOOK_DISPLAY_NAME="My application" --variable REVERSED_CLIENT_ID="com.googleusercontent.apps.9999999999-xxxxxxxxxxxxxxxxxxxxxxxxxx" --variable COLOR_PRIMARY="#ffffff" --variable COLOR_DARK_PRIMARY="#555555" --variable COLOR_LIGHT_PRIMARY="#aaaaaa" --variable COLOR_ACCENT="#7C4DFF" --variable COLOR_SECONDARY="#FFC107" --variable COLOR_CONTROL="#ffffff" --variable COLOR_BACKGROUND="#000000"
Installing "cordova-plugin-firebaseui-auth" for ios
Installing "cordova-plugin-android-fragmentactivity" for ios
Cloning into '/var/folders/6z/pjhh1g4n1cjg_5gjgphmx8s00000gn/T/d20190213-56729-1qcoii0'...
Note: checking out '937788f6c31156113480e491bef4c5c7e04ea7d9'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
Cloning into '/var/folders/6z/pjhh1g4n1cjg_5gjgphmx8s00000gn/T/d20190213-56729-qub5a2'...
Note: checking out '937788f6c31156113480e491bef4c5c7e04ea7d9'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 6768 100 6768 0 0 19332 0 --:--:-- --:--:-- --:--:-- 19282
Cloning into '/var/folders/6z/pjhh1g4n1cjg_5gjgphmx8s00000gn/T/d20190213-56729-1udfet6'...
Note: checking out '3fd239124995e1f4321c185eed0141981341349f'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
Cloning into '/var/folders/6z/pjhh1g4n1cjg_5gjgphmx8s00000gn/T/d20190213-56729-renwd1'...
Note: checking out '3fd239124995e1f4321c185eed0141981341349f'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
Cloning into '/var/folders/6z/pjhh1g4n1cjg_5gjgphmx8s00000gn/T/d20190213-56729-7oqvh4'...
Note: checking out '2d01f774f301124e1530cc63421393f8be2e0b7c'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
Adding cordova-plugin-firebaseui-auth to package.json
Saved plugin info for "cordova-plugin-firebaseui-auth" to config.xml
Remove the plugin (so it can be reinstalled with [email protected]) :
$ cordova plugin remove cordova-plugin-firebaseui-auth Uninstalling 1 dependent plugins.
Uninstalling cordova-plugin-android-fragmentactivity from ios
Uninstalling cordova-plugin-firebaseui-auth from ios
[!] The Podfile does not contain any dependencies.
Removing "cordova-plugin-firebaseui-auth"
Removing plugin cordova-plugin-firebaseui-auth from config.xml file...
Removing cordova-plugin-firebaseui-auth from package.json
Remove [email protected] as a platform:
$ cordova platform remove ios
Removing platform ios from config.xml file...
Removing ios from cordova.platforms array in package.json
Add [email protected] as a platform:
$ cordova platform add [email protected]
Using cordova-fetch for [email protected]
Adding ios project...
Creating Cordova project for the iOS platform:
Path: platforms/ios
Package: com.example.hello
Name: HelloWorld
iOS project created with [email protected]
Installing "cordova-plugin-whitelist" for ios
--save flag or autosave detected
Saving ios@~5.0.0 into config.xml file ...
$ cordova plugin add cordova-plugin-firebaseui-auth --variable ANDROID_FIREBASE_CORE_VERSION=16.0.0 --variable ANDROID_FIREBASE_AUTH_VERSION=16.0.1 --variable ANDROID_PLAY_SERVICES_AUTH_VERSION=15.0.1 --variable ANDROID_FIREBASEUI_VERSION=3.3.1 --variable ANDROID_FACEBOOK_SDK_VERSION=4.31.0 --variable FACEBOOK_APPLICATION_ID=12345678 --variable FACEBOOK_DISPLAY_NAME="My application" --variable REVERSED_CLIENT_ID="com.googleusercontent.apps.9999999999-xxxxxxxxxxxxxxxxxxxxxxxxxx" --variable COLOR_PRIMARY="#ffffff" --variable COLOR_DARK_PRIMARY="#555555" --variable COLOR_LIGHT_PRIMARY="#aaaaaa" --variable COLOR_ACCENT="#7C4DFF" --variable COLOR_SECONDARY="#FFC107" --variable COLOR_CONTROL="#ffffff" --variable COLOR_BACKGROUND="#000000"
Installing "cordova-plugin-firebaseui-auth" for ios
Installing "cordova-plugin-android-fragmentactivity" for ios
"framework" tag with type "podspec" is deprecated and will be removed. Please use the "podspec" tag.
Running command: pod install --verbose
Failed to install 'cordova-plugin-firebaseui-auth': Error: pod: Command failed with exit code 1
at ChildProcess.whenDone (/Users/rohantalip/dev/cordova-test/hello/node_modules/cordova-common/src/superspawn.js:125:23)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:962:16)
at Socket.stream.socket.on (internal/child_process.js:381:11)
at Socket.emit (events.js:182:13)
at Pipe._handle.close (net.js:610:12)
pod: Command failed with exit code 1
The scripts location is moved in Cordova 8 and this install breaks.
From readme we need:
ANDROID_FIREBASE_CORE_VERSION: the version of Firebase Core to use
ANDROID_FIREBASE_AUTH_VERSION: the version of Firebase Authentication to use
But I only ever worked with npm modules of Firebase & Firebaseui. How can I know what android version I must use?
Hi, is there a sample app / repo that might show how to utilize this?
I ended up using a combination of
cordova-plugin-firebase-authentication
cordova-plugin-googleplus
instead
My app can already launch succesfully in android simulator, but trying to get firebaseui authentication to work!
In your Readme you state that first we must "add android" to firebase app.
When I do this it says:
The Google services plugin for Gradle loads the google-services.json file that you just downloaded. Modify your build.gradle files to use the plugin.
Project-level build.gradle (<project>/build.gradle):
buildscript {
dependencies {
// Add this line
classpath 'com.google.gms:google-services:4.0.1'
}
}
Where in my cordova source files should I add this code?
Plugin should be able to install and system generate a build
getting symbol missing errors instead
error: cannot find symbol
Task :app:compileDebugJavaWithJavac
providers.add(new AuthUI.IdpConfig.GitHubBuilder().build());
install the plugin following guide on read me
run ionic cordova run android
Hi
My work environment is
Ionic: 5.4.13
Cordova: 9.0.0
The final platform are( Android and IOS).
The Firebase settings of the app are according to the indications of the site.
In the Android version everything works fine.
I have a problem in the iOS version.
environment.ts
in this class assign the parameters for IOS.
When the application is running in the Simulator or in the App, an error shows up!
Error
RecaptchaVerifier is only supported in a browser HTTP/HTTPS enviroment
thanks
I was having this error:
auth.esm.js:139 Uncaught Ui {code: "auth/internal-error", message: "The XMLHttpRequest compatibility library was not found."}
And the workaround for it to dissappear is:
window.global = window; // hack for 'FirebaseUIAuth'
Hope this helps if anyone is having the same issue. This may be useful to add in the README file.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.