⚡️ Firebase plugins for Capacitor. Supports Android, iOS and the web

Overview

Capacitor Firebase

maintenance badge workflow badge license badge maintained badge

⚡️ Firebase plugins for Capacitor. Supports Android, iOS and the web.

Maintainers

Maintainer GitHub Social
Robin Genz robingenz @robin_genz

Installation

Each plugin has its own installation instructions. Click on the name of the desired plugin under the Plugins section to get to the installation guide.

Plugins

Name Package Version Downloads
Analytics @capacitor-firebase/analytics npm badge npm downloads
App @capacitor-firebase/app npm badge npm downloads
Authentication @capacitor-firebase/authentication npm badge npm downloads
Crashlytics @capacitor-firebase/crashlytics npm badge npm downloads
Performance Monitoring @capacitor-firebase/performance npm badge npm downloads

License

See LICENSE.

Comments
  • bug: authStateChange never fires.

    bug: authStateChange never fires.

    Plugin(s): "@capacitor-firebase/authentication": "^0.5.0"

    Platform(s): Android

    Current behavior: When using const result = await FirebaseAuthentication.signInWithGoogle() for example, the login is successful and result.user is returned. However, authStateChange is never fired. Note that this works in web, but NOT on Android.

    Expected behavior: authStateChange needs to be fired on any change in auth state, e.g. re-opening app or signing out.

    Steps to reproduce:

    Related code:

      // capacitor.config.json
      "plugins": {
        "FirebaseAuthentication": {
          "skipNativeAuth": false,
          "providers": ["twitter.com", "google.com", "facebook.com"]
        },
      }
    
    // main.ts
    import { FirebaseAuthentication } from "@capacitor-firebase/authentication";
    FirebaseAuthentication.removeAllListeners().then(() => {
      FirebaseAuthentication.addListener("authStateChange", (result) => {
        if (result.user) {
          // this never fires
        } else {
          // this never fires
        }
      });
    });
    
      // Login.vue
      const signInWithGoogle = async () => {
        try {
          const result: SignInResult = await FirebaseAuthentication.signInWithGoogle();
    
          if (result.user) {
            return result.user;
          }
        } catch (err) {
          console.log(err);
        }
      };
    

    Other information: Some potentially relevant logs from Android Studio:

    V/Capacitor/FirebaseAuthenticationPlugin: Notifying listeners for event authStateChange D/Capacitor/FirebaseAuthenticationPlugin: No listeners found for event authStateChange V/Capacitor/Plugin: To native (Capacitor plugin): callbackId: 81763094, pluginId: FirebaseAuthentication, methodName: addListener V/Capacitor: callback: 81763094, pluginId: FirebaseAuthentication, methodName: addListener, methodData: {"eventName":"authStateChange"}

    Also, it looks like there's a similar issue that was closed but with no real solution, https://github.com/capawesome-team/capacitor-firebase/issues/56

    Capacitor doctor:

    Latest Dependencies:
    
      @capacitor/cli: 3.6.0
      @capacitor/core: 3.6.0
      @capacitor/android: 3.6.0
      @capacitor/ios: 3.6.0
    
    Installed Dependencies:
    
      @capacitor/cli: 3.4.3
      @capacitor/core: 3.4.3
      @capacitor/android: 3.4.3
      @capacitor/ios: 3.4.3
    
    platform: android needs: triage package: authentication 
    opened by braincomb 41
  • bug: iOS build fails with

    bug: iOS build fails with "No such module 'FirebaseCore'"

    Plugin(s):

    Analytics

    Platform(s):

    iOS

    Current behavior:

    I added the Analytics plugin as per instructions. However when I try to build the iOS app, it fails with "No such module FirebaseCore". Could somebody please help? Production app needing an update.....

    Expected behavior:

    Xcode should build successfully

    Steps to reproduce:

    Related code:

    insert short code snippets here
    

    Other information:

    Capacitor doctor:

    💊   Capacitor Doctor  💊 
    
    Latest Dependencies:
    
      @capacitor/cli: 4.1.0
      @capacitor/core: 4.1.0
      @capacitor/android: 4.1.0
      @capacitor/ios: 4.1.0
    
    Installed Dependencies:
    
      @capacitor/cli: 4.0.1
      @capacitor/core: 4.1.0
      @capacitor/android: 4.1.0
      @capacitor/ios: 4.1.0
    
    [success] iOS looking great! 👌
    [success] Android looking great! 👌
    
    needs: reproduction needs: triage package: analytics 
    opened by chrisvor 26
  • feat(authentication): add Sign-In Anonymously

    feat(authentication): add Sign-In Anonymously

    Pull request checklist

    Please check if your PR fulfills the following requirements:

    • [x] The changes have been tested successfully.
    • [x] A changeset has been created (npm run changeset).

    Close #35

    feature package: authentication 
    opened by trancee 21
  • bug: Getting addListener to fire on IOS

    bug: Getting addListener to fire on IOS

    Plugin(s): Capacitor Firebase Authentication

    Platform(s): IOS fails but web works fine

    Current behavior: When I use this plugin and console log results, the web version works fine. When I attempt to use the similar logging for Native Platform (Confirming that the Native code is working) trying the addListener command in several locations (see Github Repo) on the IOS logging does not seem to be firing

    Expected behavior: What I am wanting to achive is to get Firebase Custom Claims and report them (and then perform access actions based on those claims)

    Steps to reproduce: See Git Repo - comment with logic with various positions of the addListener

    Related code: https://github.com/sclawer/MobileApp

    Other information:

    Capacitor doctor:

    💊   Capacitor Doctor  💊 
    
    Latest Dependencies:
    
      @capacitor/cli: 3.4.3
      @capacitor/core: 3.4.3
      @capacitor/android: 3.4.3
      @capacitor/ios: 3.4.3
    
    Installed Dependencies:
    
      @capacitor/cli: 3.4.3
      @capacitor/core: 3.4.3
      @capacitor/android: 3.4.3
      @capacitor/ios: 3.4.3
    
    [success] iOS looking great! 👌
    [success] Android looking great! 👌
    
    needs: triage platform: ios package: authentication 
    opened by sclawer 19
  • feat(authentication): support Email Link Authentication

    feat(authentication): support Email Link Authentication

    Pull request checklist

    Please check if your PR fulfills the following requirements:

    • [x] The changes have been tested successfully.
    • [x] A changeset has been created (npm run changeset).

    Implements #36

    opened by trancee 15
  • bug: Firebase Messaging not initialized

    bug: Firebase Messaging not initialized

    Plugin(s):

    Platform(s):

    • ios

    Current behavior: I added the plugin to my capacitor app, set up push notifications and background modes. Added snippets as described to AppDelegate.swift and FirebaseAppDelegateProxyEnabled to Info.plist. Also added GoogleService-Info.plist to the xcode project.

    After building and running the app on a mobile device, I see these errors in xcode logs:

    [FirebaseCore][I-COR000003] The default Firebase app has not yet been configured. Add `FirebaseApp.configure()` to your application initialization. This can be done in in the App Delegate's application(_:didFinishLaunchingWithOptions:)` (or the `@main` struct's initializer in SwiftUI).
    
    [FirebaseMessaging][I-FCM002023] The object <CapacitorFirebaseMessaging.FirebaseMessaging: 0x282da5380> does not respond to -messaging:didReceiveRegistrationToken:. Please implement -messaging:didReceiveRegistrationToken: to be provided with an FCM token.
    

    Expected behavior: No warnings of uninitialized Firebase components in xcode log.

    Steps to reproduce: build and run the app.

    Related code:

    Other information:

    Capacitor doctor:

    💊   Capacitor Doctor  💊 
    
    Latest Dependencies:
    
      @capacitor/cli: 3.6.0
      @capacitor/core: 3.6.0
      @capacitor/android: 3.6.0
      @capacitor/ios: 3.6.0
    
    Installed Dependencies:
    
      @capacitor/cli: 3.5.1
      @capacitor/core: 3.6.0
      @capacitor/android: 3.6.0
      @capacitor/ios: 3.6.0
    
    [success] iOS looking great! 👌
    [success] Android looking great! 👌
    
    needs: triage package: messaging 
    opened by phal0r 15
  • bug: authStateChange doesn't fire on Log Out and open the app from App Killed use cases

    bug: authStateChange doesn't fire on Log Out and open the app from App Killed use cases

    Hi,

    I can see an issue with your demo app. The below method doesn't fire on Log out and open the app from App Kill use cases. Any clue? Thanks!

    I have used it like so:

    firebase-authentication.service.ts

     setFirebaseAuthStateChange(): void {
       FirebaseAuthentication.removeAllListeners().then(() => {
          FirebaseAuthentication.addListener('authStateChange', (change) => {
            this.ngZone.run(() => {
              this.authStateSubj.next(change);
            });
          });
        });
    }
    

    app. componnet.ts

    
      ngOnInit(): void {
        this.initializeApp();
      }
    
     private initializeApp(): void {
         this.firebaseAuthenticationService.setFirebaseAuthStateChange();
     }
    
    

    It works only when the Login use case. I have used AngularFire on many applications and below works on all the above use cases. So we would like to have the same behavior also on your plugin too. Please let me know your thoughts here.

    this.angularFireAuth.authState.subscribe(async (user: firebase.default.User) => {
     
        });
    

    Ionic:

    
       Ionic CLI                     : 6.16.3 (C:\Users\Sampath\AppData\Roaming\npm\node_modules\@ionic\cli)
       Ionic Framework               : @ionic/angular 6.0.11
       @angular-devkit/build-angular : 13.0.1
       @angular-devkit/schematics    : 13.0.1
       @angular/cli                  : 13.0.1
       @ionic/angular-toolkit        : 5.0.0
    
    Capacitor:
    
       Capacitor CLI      : 3.4.0
       @capacitor/android : 3.4.1
       @capacitor/core    : 3.4.0
       @capacitor/ios     : not installed
    
    Utility:
    
       cordova-res : 0.15.3
       native-run  : 1.5.0
    
    System:
    
       NodeJS : v14.16.1 (C:\Program Files\nodejs\node.exe)
       npm    : 6.14.12
       OS     : Windows 10
    
    needs: reproduction needs: triage 
    opened by Sampath-Lokuge 15
  • feat(authentication): expose `AdditionalUserInfo`

    feat(authentication): expose `AdditionalUserInfo`

    Is your feature request related to an issue? Please describe:

    Yeah. In social media entries (Facebook, Google, GooglePlay, Twitter, Apple etc.), the user's id value connected to the provider does not appear. (GoogleId value does not come for login with Google.)

    Describe your desired solution:

    When the user logs in, the user's id value can be added according to the response that the provider returns. (I left a small demo below)

    Describe the alternatives you are considering:

    I mentioned it in the additional context section.

    Additional context:

    I have attached the codes to be edited. This is for android only. It works successfully when I tested it for Facebook, Google and Twitter.

    Thanks for your time!

    1. FirebaseAuthenticationHelper.java

    // updated one function

    
    // update params
    
        public static JSObject createSignInResult(FirebaseUser user, AuthCredential credential, String idToken, String id) {
            JSObject userResult = FirebaseAuthenticationHelper.createUserResult(user);
            JSObject credentialResult = FirebaseAuthenticationHelper.createCredentialResult(credential, idToken); // update call params
            JSObject result = new JSObject();
            
    // add next line
    
           userResult.put("id", id); // add this line
            result.put("user", userResult);
            result.put("credential", credentialResult);
            return result;
        }
    
    
    1. FirebaseAuthentication.java

    // updated two functions

    
        public void signInWithCustomToken(PluginCall call) {
            boolean skipNativeAuth = this.config.getSkipNativeAuth();
            if (skipNativeAuth) {
                call.reject(ERROR_CUSTOM_TOKEN_SKIP_NATIVE_AUTH);
                return;
            }
    
            String token = call.getString("token", "");
    
            firebaseAuthInstance
                .signInWithCustomToken(token)
                .addOnCompleteListener(
                    plugin.getActivity(),
                    new OnCompleteListener<AuthResult>() {
                        @Override
                        public void onComplete(@NonNull Task<AuthResult> task) {
                            if (task.isSuccessful()) {
                                Log.d(FirebaseAuthenticationPlugin.TAG, "signInWithCustomToken succeeded.");
                                FirebaseUser user = getCurrentUser();
    
    // updated next line
    
    JSObject signInResult = FirebaseAuthenticationHelper.createSignInResult(user, null, null, null); // update call params
                                call.resolve(signInResult);
                            } else {
                                Log.e(FirebaseAuthenticationPlugin.TAG, "signInWithCustomToken failed.", task.getException());
                                call.reject(ERROR_SIGN_IN_FAILED);
                            }
                        }
                    }
                )
                .addOnFailureListener(
                    plugin.getActivity(),
                    new OnFailureListener() {
                        @Override
                        public void onFailure(@NonNull Exception) {
                            Log.e(FirebaseAuthenticationPlugin.TAG, "signInWithCustomToken failed.", exception);
                            call.reject(ERROR_SIGN_IN_FAILED);
                        }
                    }
                );
        }
    
    // 1. update params    
    
    public void handleSuccessfulSignIn(final PluginCall call, AuthCredential credential, String idToken, String id) {
            boolean skipNativeAuth = this.config.getSkipNativeAuth();
            if (skipNativeAuth) {
    
    // 2. update call params
    
                JSObject signInResult = FirebaseAuthenticationHelper.createSignInResult(null, credential, idToken, id); // update call params
                call.resolve(signInResult);
                return;
            }
            firebaseAuthInstance
                .signInWithCredential(credential)
                .addOnCompleteListener(
                    plugin.getActivity(),
                    new OnCompleteListener<AuthResult>() {
                        @Override
                        public void onComplete(@NonNull Task<AuthResult> task) {
                            if (task.isSuccessful()) {
                                Log.d(FirebaseAuthenticationPlugin.TAG, "signInWithCredential succeeded.");
                                FirebaseUser user = getCurrentUser();
    
    // 3. update call params
    
                                JSObject signInResult = FirebaseAuthenticationHelper.createSignInResult(user, credential, idToken, id); // update call params
                                call.resolve(signInResult);
                            } else {
                                Log.e(FirebaseAuthenticationPlugin.TAG, "signInWithCredential failed.", task.getException());
                                call.reject(ERROR_SIGN_IN_FAILED);
                            }
                        }
                    }
                )
                .addOnFailureListener(
                    plugin.getActivity(),
                    new OnFailureListener() {
                        @Override
                        public void onFailure(@NonNull Exception exception) {
                            Log.e(FirebaseAuthenticationPlugin.TAG, "signInWithCredential failed.", exception);
                            call.reject(ERROR_SIGN_IN_FAILED);
                        }
                    }
                );
        }
    
    
    1. handlers/PlayGamesAuthProviderHandler.java

    update one Function

    
        public void handleOnActivityResult(PluginCall call, ActivityResult result) {
            Intent data = result.getData();
            Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);
            try {
                GoogleSignInAccount account = task.getResult(ApiException.class);
                String serverAuthCode = account.getServerAuthCode();
                AuthCredential credential = PlayGamesAuthProvider.getCredential(serverAuthCode);
                String idToken = account.getIdToken();
                String id = account.getId(); // add this and update call from next line
                pluginImplementation.handleSuccessfulSignIn(call, credential, idToken, id); // update call params
            } catch (ApiException exception) {
                pluginImplementation.handleFailedSignIn(call, null, exception);
            }
        }
    
    
    1. handlers/PhoneAuthProviderHandler

    // updated three functions

    
        private void handleVerificationCode(PluginCall call, String verificationId, String verificationCode) {
            PhoneAuthCredential credential = PhoneAuthProvider.getCredential(verificationId, verificationCode);
    
    // update call params from next line
    
            pluginImplementation.handleSuccessfulSignIn(call, credential, null, null); // update call params
        }
    
                @Override
                public void onVerificationCompleted(PhoneAuthCredential credential) {
    
    // update call params from next line
    
                    pluginImplementation.handleSuccessfulSignIn(call, credential, null, null); // update call params
                }
    
                @Override
                public void onCodeSent(@NonNull String verificationId, @NonNull PhoneAuthProvider.ForceResendingToken token) {
    
    // update call params from next line             
    
       JSObject result = FirebaseAuthenticationHelper.createSignInResult(null, null, null, null); // update call params
                    result.put("verificationId", verificationId);
                    call.resolve(result);
                }
    
    
    1. handlers/OAuthProviderHandler

    // update two functions

    
        private void startActivityForSignIn(final PluginCall call, OAuthProvider.Builder provider) {
            pluginImplementation
                .getFirebaseAuthInstance()
                .startActivityForSignInWithProvider(pluginImplementation.getPlugin().getActivity(), provider.build())
                .addOnSuccessListener(
                    authResult -> {
                        AuthCredential credential = authResult.getCredential();
                        
    // add next line and update call params
    
    Object userId = authResult.getAdditionalUserInfo().getProfile().get("id");
                        pluginImplementation.handleSuccessfulSignIn(call, credential, null, userId.toString()); // update call params
                    }
                )
                .addOnFailureListener(exception -> pluginImplementation.handleFailedSignIn(call, null, exception));
        }
    
        private void finishActivityForSignIn(final PluginCall call, Task<AuthResult> pendingResultTask) {
            pendingResultTask
                .addOnSuccessListener(
                    authResult -> {
                        AuthCredential credential = authResult.getCredential();
                        
    // add next line and update call params
    
    Object userId = authResult.getAdditionalUserInfo().getProfile().get("id");
                        pluginImplementation.handleSuccessfulSignIn(call, credential, null,  userId.toString()); // update call params
                    }
                )
                .addOnFailureListener(exception -> pluginImplementation.handleFailedSignIn(call, null, exception));
        }
    
    
    1. handlers/GoogleAuthProviderHandler

    update one function

    
        public void handleOnActivityResult(PluginCall call, ActivityResult result) {
            Intent data = result.getData();
            Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);
            try {
                GoogleSignInAccount account = task.getResult(ApiException.class);
                String idToken = account.getIdToken();
    
    // add next line and update call params
    
                String id = account.getId();
                AuthCredential credential = GoogleAuthProvider.getCredential(idToken, null);
                pluginImplementation.handleSuccessfulSignIn(call, credential, idToken, id); // update call params
            } catch (ApiException exception) {
                pluginImplementation.handleFailedSignIn(call, null, exception);
            }
        }
    
    
    1. handlers/FacebookAuthProviderHandler

    update one function

    
        private void handleSuccessCallback(LoginResult loginResult) {
            AccessToken accessToken = loginResult.getAccessToken();
            String token = accessToken.getToken();
    
    // add next line and update call params     
    
       String id = accessToken.getUserId();
            AuthCredential credential = FacebookAuthProvider.getCredential(token);
            pluginImplementation.handleSuccessfulSignIn(savedCall, credential, token, id); // update call params
        }
    
    
    feature priority: medium package: authentication 
    opened by ssibrahimbas 15
  • bug: Twitter auth provider cannot transition from native auth to Firebase JS SDK auth

    bug: Twitter auth provider cannot transition from native auth to Firebase JS SDK auth

    Plugin(s): @capacitor-firebase/[email protected]

    Platform(s): iOS

    Current behavior: Twitter Auth Provider cannot transition from native auth to Firebase JS SDK auth. The FirebaseAuthentication.signInWithTwitter() method returns no result.credential.accessToken nor result.credential.secret (both undefined). Thus I'm unable to get the OAuthCredential using const nativeCredential = TwitterAuthProvider.credential(result.credential?.accessToken, result.credential?.secret) in order to perform the authentication on the web layer with signInWithCredential(auth, nativeCredential).

    Expected behavior: Twitter auth provider returns credential.accessToken and credential.secret (like it does on Android) and we can use those to perform the authentication on the web layer with signInWithCredential(auth, nativeCredential).

    Steps to reproduce: I followed the steps mentioned in the How to use this plugin with the Firebase JavaScript SDK guide.

    Related code: But as the Twitter example is missing I used the following (based on the other examples)

    const signInWithTwitter = async () => {
      // 1. Create credentials on the native layer
      const result = await FirebaseAuthentication.signInWithTwitter();
      // 2. Sign in on the web layer using the access token
      const credential = TwitterAuthProvider.credential(result.credential?.accessToken, result.credential?.secret);
      const auth = getAuth();
      await signInWithCredential(auth, credential);
    };
    

    Other information: My project is working fine on Android and the web. On iOS I got these errors on the Safari DevTools console:

    • FirebaseError: Firebase: Error (auth/argument-error).
    • null is not an object (evaluating 'credential._getIdTokenResponse')

    This is the way I'm initializing the @angular/fire library in my NgModule according to this comment and this comment:

    ...
    
    provideFirebaseApp(() => {
        const app = initializeApp(environment.firebase);
    
        if (Capacitor.isNativePlatform()) {
          initializeAuth(app, {
            persistence: indexedDBLocalPersistence
          });
        }
        return app;
      }),
      provideAuth(() => getAuth())
    
    ...
    

    I also tried this alternate init with no luck. I don't believe this is the cause anyway:

    provideFirebaseApp(() => initializeApp(environment.firebase)),
    provideAuth(() => {
      if (Capacitor.isNativePlatform()) {
        return initializeAuth(getApp(), {
          persistence: indexedDBLocalPersistence
        });
      } else {
        return getAuth();
      }
    }),
    

    Capacitor doctor:

    💊   Capacitor Doctor  💊 
    
    Latest Dependencies:
    
      @capacitor/cli: 3.5.1
      @capacitor/core: 3.5.1
      @capacitor/android: 3.5.1
      @capacitor/ios: 3.5.1
    
    Installed Dependencies:
    
      @capacitor/cli: 3.5.1
      @capacitor/ios: 3.5.1
      @capacitor/android: 3.5.1
      @capacitor/core: 3.5.1
    
    [success] iOS looking great! 👌
    [error] Missing <manifest package=""> attribute in app/src/main
    
    bug/fix platform: ios package: authentication 
    opened by agustinhaller 12
  • feat(authentication): support sign-in with redirect on Web

    feat(authentication): support sign-in with redirect on Web

    Pull request checklist

    Please check if your PR fulfills the following requirements:

    • [x] The changes have been tested successfully.
    • [x] A changeset has been created (npm run changeset).

    Close #224

    platform: web feature package: authentication 
    opened by robingenz 11
  • bug:  signInWithGoogle

    bug: signInWithGoogle

    Plugin(s):

    "@capacitor-firebase/app": "^1.0.0", "@capacitor-firebase/authentication": "^1.0.0",

    Platform(s):

    iOS

    Current behavior:

    When trying to signInWithGoogle the function runs but no pop up occurs and no data is being returned. To Native -> FirebaseAuthentication signInWithGoogle 60979170 is the message I get in the logs.

    Expected behavior:

    Assume a pop up should come up and ask me to sign in with google have tried same code and another plugin all works but wanted to use this plugin.

    Steps to reproduce:

    Install, setup the signInWithGoogle function and nothing happens

    Related code:

    const result = await FirebaseAuthentication.signInWithGoogle();
    

    Other information:

    Capacitor doctor:

    💊   Capacitor Doctor  💊 
    
    Latest Dependencies:
    
      @capacitor/cli: 4.1.0
      @capacitor/core: 4.1.0
      @capacitor/android: 4.1.0
      @capacitor/ios: 4.1.0
    
    Installed Dependencies:
    
      @capacitor/cli: 4.1.0
      @capacitor/core: 4.1.0
      @capacitor/android: 4.1.0
      @capacitor/ios: 4.1.0
    
    [success] iOS looking great! 👌
    
    needs: reproduction needs: triage package: app package: authentication 
    opened by DeveloperAdam-github 11
  • feat(authentication): add method `setPersistence`

    feat(authentication): add method `setPersistence`

    Is your feature request related to a problem? Please describe:

    Auth state persistence specifies how a user session is persisted on a device. You can specify how the Authentication state persists when using the Firebase JS SDK.

    Describe the solution you'd like:

    Add method setPersistence.

    Describe alternatives you've considered:

    Additional context:

    https://firebase.google.com/docs/auth/web/auth-state-persistence

    feature package: authentication 
    opened by trancee 0
  • feat(authentication): support `signInWithPhoneNumber` on Web

    feat(authentication): support `signInWithPhoneNumber` on Web

    Pull request checklist

    Please check if your PR fulfills the following requirements:

    • [ ] The changes have been tested successfully.
    • [ ] A changeset has been created (npm run changeset).

    Close #26

    platform: web feature package: authentication 
    opened by robingenz 0
  • feat(authentication): Handle FIRAuthErrorUserInfoUpdatedCredentialKey on link errors with Apple Sign In

    feat(authentication): Handle FIRAuthErrorUserInfoUpdatedCredentialKey on link errors with Apple Sign In

    Is your feature request related to a problem? Please describe: Upgrading an anonymous user requires you to link the anonymous account with a credential. This operation will fail if the credential is already associated with another account. A common use case at this point is to sign in to the existing account (so that a single Sign in with Apple button press can intelligently "register" [upgrade the anonymous account] or sign into an existing account with one click).

    For a lot of other auth providers the original credential can be reused for the sign in operation. But for Apple, the original credential can't be reused. However, Firebase automatically provides an updated credential key within the error (FIRAuthErrorUserInfoUpdatedCredentialKey) that can be used afterwards for the sign in operation.

    Without this updated credential key it's not possible to implement a sign in/register flow using native Apple Sign In for apps that use anonymous accounts.

    Describe the solution you'd like: If FirebaseAuthentication.linkWithApple fails and the firebase error code is 'auth/credential-already-in-use', then there should be an updatedCredentialKey property that's added on to to the error that contains the retry token and a way to then sign in to Firebase using the updated credential.

    Describe alternatives you've considered: From what I've seen, the only alternative would be to show the sign in screen twice to the user, but the UX on this would be confusing and not ideal.

    Without the FIRAuthErrorUserInfoUpdatedCredentialKey there are no real/proper alternative solutions that'll work.

    Additional context: This isn't a problem if your app doesn't use anonymous accounts since FirebaseAuthentication.signInWithApple will already either register or login for you.

    We only need this for iOS in our app. I'm going to try and implement the iOS fix for this when I get time, but my Swift knowledge isn't great so I'm sure somebody else might be able to get it done faster if they wanted to.

    feature package: authentication 
    opened by jswilliams 0
  • feat(authentication): allow custom oAuth providers

    feat(authentication): allow custom oAuth providers

    Is your feature request related to a problem? Please describe:

    firebase now supports custom OpenID and SAML providers

    Describe the solution you'd like:

    add a method like signInWithCustomProvider

    Describe alternatives you've considered:

    NA

    Additional context:

    Android implementation IOS implementation Web Implementation

    feature package: authentication 
    opened by LisaScheers 0
  • feat(remote-config): support retrieving JSON-like array and object values

    feat(remote-config): support retrieving JSON-like array and object values

    Is your feature request related to a problem? Please describe: Remote Config allows for storing JSON values like arrays and objects but I don't think currently using the available methods those can be accessed.

    Screenshot 2022-11-27 at 6 52 57 PM

    Screenshot 2022-11-27 at 6 54 07 PM

    Describe the solution you'd like: I would like to have some kind of support for retrieving JSON data from the Remote Config.

    Describe alternatives you've considered: I tried getting the data using getString in hopes that I could just JSON.parse it but it doesn't appear that works. An argument could also be made for just flattening out objects but this doesn't work with arrays and sometimes it's nice to group a larger set of settings into a kind keyed config value.

    Additional context: I'm not sure how to do this with the web SDK but for Android and iOS they provide an asByteArray method which can be used to get array and object data to return to the client. Here are some snippet that might be helpful that I've used in some of my own custom projects:

    Android
    @PluginMethod
        public void getArray(PluginCall call) {
            final String name = call.getString("name", "");
    
            if (!initialized) {
                call.reject("Remote Config has not been initialized!");
    
                return;
            }
    
            if (name == null || name.equals("")) {
                call.reject("Remote Config name is required!");
    
                return;
            }
    
            final byte[] value = getRemoteConfigValue(name).asByteArray();
            final JSObject result = new JSObject();
    
            try {
                final JSArray array = new JSArray(new String(value));
    
                result.put("name", name);
                result.put("type", "array");
                result.put("value", array);
    
                call.resolve(result);
            } catch (JSONException e) {
                call.reject("Unable to parse Remote Config array: " + e.getLocalizedMessage());
            }
        }
    
    @PluginMethod
        public void getObject(PluginCall call) {
            final String name = call.getString("name", "");
    
            if (!initialized) {
                call.reject("Remote Config has not been initialized!");
    
                return;
            }
    
            if (name == null || name.equals("")) {
                call.reject("Remote Config name is required!");
    
                return;
            }
    
            final byte[] value = getRemoteConfigValue(name).asByteArray();
            final JSObject result = new JSObject();
    
            try {
                final JSObject json = new JSObject(new String(value));
    
                result.put("name", name);
                result.put("type", "object");
                result.put("value", json);
    
                call.resolve(result);
            } catch (JSONException e) {
                call.reject("Unable to parse Remote Config object: " + e.getLocalizedMessage());
            }
        }
    
    iOS
    @objc func getArray(_ call: CAPPluginCall) {
            let name = call.getString("name") ?? ""
            
            if !initialized {
                call.reject("Remote Config has not been initialized!")
                return
            }
            
            if name.isEmpty {
                call.reject("Remote Config name is required!")
                return
            }
            
            let value = self.remoteConfig?.configValue(forKey: name)
            
            do {
                let json = try JSONSerialization.jsonObject(with: value!.dataValue, options: []) as? [Any]
                
                call.resolve([
                    "name": name,
                    "type": "array",
                    "value": json ?? []
                ])
            } catch {
                call.reject("Unable to parse Remote Config object!")
            }
        }
    
    @objc func getObject(_ call: CAPPluginCall) {
            let name = call.getString("name") ?? ""
            
            if !initialized {
                call.reject("Remote Config has not been initialized!")
                return
            }
            
            if name.isEmpty {
                call.reject("Remote Config name is required!")
                return
            }
            
            let value = self.remoteConfig?.configValue(forKey: name)
            
            do {
                let json = try JSONSerialization.jsonObject(with: value!.dataValue, options: []) as? [String : Any]
                
                call.resolve([
                    "name": name,
                    "type": "object",
                    "value": json ?? {}
                ])
            } catch {
                call.reject("Unable to parse Remote Config object!")
            }
        }
    
    feature package: remote-config 
    opened by mcfarljw 2
  • feat(remote-config): support default values

    feat(remote-config): support default values

    Is your feature request related to a problem? Please describe:

    Default values are currently not officially supported and have to be implemented with a workaournd.

    Describe the solution you'd like:

    It would be great if you don't need this workaround and can tell Firebase Remote Config the default values. Add a FirebaseRemoteConfig.setDefaults(...) method.

    Describe alternatives you've considered:

    Additional context:

    feature package: remote-config 
    opened by robingenz 0
Releases(@capacitor-firebase/[email protected])
Owner
Robin Genz
🎓 CS Student and Full Stack Developer 💯 Open Source Maintainer ⚡️ @capacitor-community Member 💙 @ionic-team Insider
Robin Genz
A webserver interface to the same methods and code that Cordova plugins install.

cordova-plugin-webserver Cordova plugin for localhost web server written in Kotlin and Ktor Install plugin cordova plugin add https://github.com/Qbix/

Qbix 0 May 5, 2022
My plugins for Aliucord, an android Discord client mod

Ven's Aliucord Plugins Click a Plugin's name to open a more detailed explanation Themer - Download Create and apply custom themes EmojiUtility - Downl

Ven 139 Dec 28, 2022
My (terrible) plugins for Aliucord

Plugins for Aliucord How to install: Join the Aliucord support server long press on my message in #plugins-list then click "Open PluginDownloader" Man

Animal 37 Nov 3, 2022
Library for testing highlighting in plugins for IDEA in KPHP format.

intellij-kphp-highlighting-test-adapter Library for testing highlighting in plugins for IDEA in KPHP format. Installation Kotlin DSL plugins { id(

Makhnev Petr 2 Jul 23, 2022
Android plugin to publish bundles and apks to Firebase App Distribution with changelogs

build-publish-plugin A configurable plugin to generate changelogs from tags and publish results into Firebase App Distribution and send changelog to T

KODE 5 Dec 24, 2022
🌏 Android/IDEA localization plugin. supports multiple languages and multiple translators.

English | 简体中文 AndroidLocalizePlugin ?? Android/IDEA localization plugin. supports multiple languages and multiple translators. Features Multiple tran

Airsaid 465 Dec 28, 2022
Intellij Idea Plugin that can convert HTML to Compose for Web code.

HtmlToComposeWebConverter Intellij Idea Plugin that can convert HTML to Compose for Web code. Turn this: Into this: Show some ❤️ and star the repo to

Jens Klingenberg 90 Oct 10, 2022
GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.

Gradle Play Publisher Gradle Play Publisher is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and

null 3.9k Dec 30, 2022
Helper to upload Gradle Android Artifacts, Gradle Java Artifacts and Gradle Kotlin Artifacts to Maven repositories (JCenter, Maven Central, Corporate staging/snapshot servers and local Maven repositories).

GradleMavenPush Helper to upload Gradle Android Artifacts, Gradle Java Artifacts and Gradle Kotlin Artifacts to Maven repositories (JCenter, Maven Cen

 Vorlonsoft LLC 21 Oct 3, 2022
A plugin for Android Studio and Intellij IDEA that speeds up your day to day android development.

ADB Idea A plugin for Android Studio and Intellij IDEA that speeds up your day to day android development. The following commands are provided: Uninst

Philippe Breault 2k Dec 28, 2022
Maven Plugin for Android Application development and more

ANDROID MAVEN PLUGIN A plugin for Android application development with Apache Maven 3.0.5+ and the Android SDK. Please check out our website for furth

simpligility 1k Jan 4, 2023
Gradle plugin which downloads and manages your Android SDK.

DEPRECATED This plugin is deprecated and is no longer being developed. Tools and dependencies are automatically downloaded using version 2.2.0 of the

Jake Wharton 1.4k Dec 29, 2022
This is an android studio plugin that allows you to creates new color in hex format based on a percentage (0-100) and a base color you specify.

alpha-color Description This is an android studio plugin that allows you to creates new color in hex format based on a percentage (0-100) and a base c

null 1 Nov 12, 2021
A full-featured package manager and viewer for Android

App Manager Docs · Releases · Telegram Channel Features General features Fully reproducible, copylefted libre software (GPLv3+) Material design (but n

Muntashir Al-Islam 2.3k Dec 29, 2022
IntelliJ plugin that provides a modern and powerful byte code analyzer tool window.

IntelliJ Byte Code Analyzer Plugin This IntelliJ plugin provides a modern and powerful byte code analyzer tool window. Its supports Java, Kotlin, Groo

Marcel Kliemannel 29 Nov 9, 2022
CKlib is a gradle plugin that will build and package C/C++/Objective-C code for Kotlin/Native.

C Klib CKlib is a gradle plugin that will build and package C/C++/Objective-C code for Kotlin/Native. The Problem When you want to access C-etc code f

Touchlab 73 Nov 8, 2022
Process jacoco reports and print the code coverage to the Azure DevOps

PrintCoverage PrintCoverage plugin allows you easily integrate coverage badge into your Azure DevOps pull requests! How to use In the module build.gra

Intermedia Cloud Communications 4 Oct 15, 2021
🤹 Common Kotlin utilities made for my personal usage, comes with SLF4J utilities, common extensions, common Gradle utilities, and more.

?? common-utils Common Kotlin utilities made for my personal usage, comes with SLF4J utilities, common extensions, ansi-colours, common Gradle utiliti

Noel ʕ •ᴥ•ʔ 6 Dec 2, 2022