GithubHelp home page GithubHelp logo

capawesome-team / capacitor-firebase Goto Github PK

View Code? Open in Web Editor NEW
355.0 14.0 84.0 1.6 MB

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

Home Page: https://capawesome.io/plugins/firebase/

License: Apache License 2.0

Ruby 1.83% Java 44.85% Objective-C 2.19% Swift 27.82% JavaScript 0.99% TypeScript 22.32%
capacitor capacitor-plugin capacitor-community android ios web firebase firebase-crashlytics firebase-performance firebase-analytics

capacitor-firebase's People

Contributors

arstrasser avatar bitekas avatar cconn avatar chelopme avatar chrisk8er avatar dependabot[bot] avatar dmitrysboychakov avatar github-actions[bot] avatar jonz94 avatar matthewbal avatar meds avatar mesqueeb avatar mikesol avatar mverdon avatar nkalupahana avatar nlueg avatar piotr-cz avatar r0hin avatar riderx avatar robingenz avatar tamilselvanmariyappan avatar timo-haas avatar trancee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

capacitor-firebase's Issues

bug: String parameters in 'logEvent' are sent as 'String' instead of the parameter value

Plugin(s):
"@capacitor-firebase/analytics": "^0.2.1",

Platform(s):
Android

Current behavior:
Any string parameter passed through to FirebaseAnalytics.logEvent() is being logged with the value 'String'.

Expected behavior:
The value displayed in the console should match the value passed through to FirebaseAnalytics.logEvent()

Steps to reproduce:
Pass a parameter with a string value to FirebaseAnalytics.logEvent()

Related code:

FirebaseAnalytics.logEvent({
  name: 'test_event',
  params: {
    foo: 'bar',
  },
});

Other information:
image

I think it could be this line causing the problem https://github.com/robingenz/capacitor-firebase/blob/main/packages/analytics/android/src/main/java/dev/robingenz/capacitorjs/plugins/firebase/analytics/FirebaseAnalyticsHelper.java#L112

bundle.putString(key, value.getClass().getSimpleName());

instead of

bundle.putString(key, (String) value);

Capacitor doctor:

💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 3.5.0
  @capacitor/core: 3.5.0
  @capacitor/android: 3.5.0
  @capacitor/ios: 3.5.0

Installed Dependencies:

  @capacitor/android: 3.4.3
  @capacitor/ios: 3.4.3
  @capacitor/cli: 3.4.3
  @capacitor/core: 3.4.3

[success] iOS looking great! 👌
[success] Android looking great! 👌

feat: support Firebase Authentication

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

Firebase Authentication is not currently supported.

Describe the solution you'd like:

Add a Firebase Authentication plugin.

Describe alternatives you've considered:

Additional context:

feat: support Firebase Analytics

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

Firebase Analytics is not currently supported.

Describe the solution you'd like:

Add a Firebase Analytics plugin.

Describe alternatives you've considered:

Additional context:

feat: support Firebase Crashlytics

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

Firebase Crashlytics is not currently supported.

Describe the solution you'd like:

Add a Firebase Crashlytics plugin.

Describe alternatives you've considered:

Additional context:

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
    }

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! 👌

bug: screenClassOverride value showing incorrect in firebase console

Plugin(s):

"@capacitor-firebase/analytics": "^0.1.1"
"firebase": "^9.6.5",

Platform(s):

Android

Current behavior:

I'm passing different values for screenName, screenClassOverride in setScreenName method. But in firebase console, i'm seeing firebase_screen_class value as firebase_screen.

Expected behavior:

firebase_screen_class should be taken from screenClassOverride

Steps to reproduce:

Related code:

const setScreenName = async () => {
await FirebaseAnalytics.setCurrentScreen({
screenName: 'Homepage',
screenClassOverride: 'Home',
})
}

Other information:

screen1
screen2

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/core: 3.4.1
@capacitor/android: 3.4.0
@capacitor/cli: 3.4.1
@capacitor/ios: 3.4.0

bug: `accessToken` is returned as `idToken`

Plugin(s):

  • @capacitor-firebase/authentication

Platform(s):

  • Android
  • iOS

Current behavior:

Facebook access token is returned as idToken (see https://github.com/robingenz/capacitor-firebase/blob/66b54eef2f1b13c9527ced66e52a012d763da99d/packages/authentication/android/src/main/java/dev/robingenz/capacitorjs/plugins/firebase/authentication/handlers/FacebookAuthProviderHandler.java#L74).

Expected behavior:

Facebook access token should only be returned as access token.

Steps to reproduce:

Related code:

insert short code snippets here

Other information:

Capacitor doctor:

insert the output from `npx cap doctor` here

bug: Error: There was an error while trying to get your package certificate hash

Plugin(s):

"@capacitor-firebase/authentication": "^0.2.1",

Platform(s):

android

Current behavior:

I have been using Twitter Auth on Android via "skipNativeAuth": true,
I had temporarily disabled this today: "skipNativeAuth": false, and it broke some signin methods.
So I had re-enabled it again.

Ever since then I cannot use twitter auth on android any more:

Error: There was an error while trying to get your package certificate hash.
at Object.cap.fromNative (VM3:411:32)
at :1:18

I have cleaned the build folder. Double checked the certificate hash is registered on Firebase, double checked all Twitter requirements, but cannot seem to find the cause for this issue. : S

It won't go to the auth page even.

Steps to reproduce:

I can provide aab if required.

Related code:

  async function signinWithTwitter(): Promise<void> {
    if (platform === 'android') {
      // 1. Create credentials on the native layer
      const result: SignInResult = await FirebaseAuthentication.signInWithTwitter()

      const { accessToken, secret } = result.credential || {}
      if (!accessToken || !secret) {
        throw new Error('twitter error')
      }

      // 2. Create credentials on the web layer
      const credential = TwitterAuthProvider.credential(accessToken, secret)
      // 3. Sign in on the web layer using the id token
      await signInWithCredential(firebaseAuth, credential)
    }

Other information:

image

Capacitor doctor:

npx cap 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! 👌

bug(authentication): Default FirebaseApp is not initialized

Plugin version:
0.4.3

Platform(s):
Android, iOS

Current behavior:
After installing the plugin and performing npx cap sync, when trying to run the application in Android Studio it crashes with the following error in the logs:
Default FirebaseApp is not initialized in this process com.example.myapp. Make sure to call FirebaseApp.initializeApp(Context) first.

I have been following the example from your demo app and have included the initialization in the constructor of my app.component.ts. I even copied your FirebaseAuthenticationService (and basically the whole "core" folder) to try to get as close as I could to your demo.

It gives a similar error in XCode with the emulator, but doesn't crash (but also doesn't authentication for either Google or Facebook). Other methods seem to at least fire up the browser window, though I don't have them enabled in Firebase.

Expected behavior:
Expect the app to not crash on load and to authenticate users via Google.

Steps to reproduce:
In my instance, I simply installed the plugin into an existing project and ran npx cap sync.

Related code:
From app.component.ts:

  constructor(
    private readonly firebaseAuthenticationService: FirebaseAuthenticationService
  ) {
    this.initializeApp();
  }
  private async initializeApp(): Promise<void> {
    await this.firebaseAuthenticationService.initialize();
  }

Other information:
None

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/android: 3.4.3
  @capacitor/core: 3.4.3
  @capacitor/ios: 3.4.3

[success] Android looking great! 👌

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

bug: no accessToken

Plugin(s):
authentication 0.2.1

Platform(s):
Android/iOS

Current behavior:
Can not get the accessToken with Google Login on Android and
can not get the accessToken with Microsoft Login on iOS.

Did not test the other methods at the moment.

Expected behavior:
Get the accessToken with all login methods and on every platform

Steps to reproduce:
Just use the plugin. Everyone in my team has the same behavior.

Related code:

export async function signInWithGoogle() {
await FirebaseAuthentication.signInWithGoogle().then((result) => {
console.log("result; ", result);
console.log("accessToken: ", result.credential?.accessToken);
});
}

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/android: 3.4.3
@capacitor/core: 3.4.3
@capacitor/ios: 3.4.3

[success] iOS looking great! 👌
[success] Android looking great! 👌

bug: signInWithApple results in auth/missing-or-invalid-nonce

Plugin(s):

"@capacitor-firebase/authentication": "^0.1.1"

Platform(s):

iOS

Current behavior:

signInWithApple() returns a credential that when used with OAuthProvider('apple.com').credential() results in Error auth/missing-or-invalid-nonce. I have confirmed that a nonce is passed as well as the idToken.

    const { credential } = await FirebaseAuthentication.signInWithApple();

    const cred = new OAuthProvider('apple.com').credential({
        idToken: credential.idToken,
        rawNonce: credential.nonce
    });

    await linkWithCredential(this.auth.currentUser, cred);

Expected behavior:

The ability to authenticate via Apple without logging Error auth/missing-or-invalid-nonce

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

feat(authentication): add Sign-In Anonymously

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

Sign-In Anonymously is currently not supported.

Describe the solution you'd like:

Support Sign-In Anonymously and linkWith... methods.

Methods:

  • signInAnonymously
  • linkWithApple
  • linkWithGoogle
  • ...

bug: app crashes `java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.auth.api.signin.GoogleSignIn"`

Plugin(s):

  • "@robingenz/capacitor-firebase-authentication": "^0.4.0",

I should upgrade to this, but haven't done yet. However, since today, not sure what went wrong, but I cannot launch on android anymore.

I found this error log:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.colorfulcast.beta, PID: 11454
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/auth/api/signin/GoogleSignIn;
        at dev.robingenz.capacitorjs.plugins.firebase.auth.handlers.GoogleAuthProviderHandler.<init>(GoogleAuthProviderHandler.java:30)
        at dev.robingenz.capacitorjs.plugins.firebase.auth.FirebaseAuthentication.initAuthProviderHandlers(FirebaseAuthentication.java:272)
        at dev.robingenz.capacitorjs.plugins.firebase.auth.FirebaseAuthentication.<init>(FirebaseAuthentication.java:52)
        at dev.robingenz.capacitorjs.plugins.firebase.auth.FirebaseAuthenticationPlugin.load(FirebaseAuthenticationPlugin.java:25)
        at com.getcapacitor.PluginHandle.load(PluginHandle.java:95)
        at com.getcapacitor.PluginHandle.<init>(PluginHandle.java:59)
        at com.getcapacitor.Bridge.registerPlugin(Bridge.java:503)
        at com.getcapacitor.Bridge.registerAllPlugins(Bridge.java:458)
        at com.getcapacitor.Bridge.<init>(Bridge.java:188)
        at com.getcapacitor.Bridge.<init>(Bridge.java:65)
        at com.getcapacitor.Bridge$Builder.create(Bridge.java:1288)
        at com.getcapacitor.BridgeActivity.load(BridgeActivity.java:72)
        at com.getcapacitor.BridgeActivity.onStart(BridgeActivity.java:110)
        at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1391)
        at android.app.Activity.performStart(Activity.java:7157)
        at android.app.ActivityThread.handleStartActivity(ActivityThread.java:2968)
        at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180)
        at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165)
        at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1836)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6702)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.auth.api.signin.GoogleSignIn" on path: DexPathList[[zip file "/data/app/com.colorfulcast.beta-nio1AIK37LpTmCyQWjWt4w==/base.apk"],nativeLibraryDirectories=[/data/app/com.colorfulcast.beta-nio1AIK37LpTmCyQWjWt4w==/lib/arm64, /system/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at dev.robingenz.capacitorjs.plugins.firebase.auth.handlers.GoogleAuthProviderHandler.<init>(GoogleAuthProviderHandler.java:30) 
        at dev.robingenz.capacitorjs.plugins.firebase.auth.FirebaseAuthentication.initAuthProviderHandlers(FirebaseAuthentication.java:272) 
        at dev.robingenz.capacitorjs.plugins.firebase.auth.FirebaseAuthentication.<init>(FirebaseAuthentication.java:52) 
        at dev.robingenz.capacitorjs.plugins.firebase.auth.FirebaseAuthenticationPlugin.load(FirebaseAuthenticationPlugin.java:25) 
        at com.getcapacitor.PluginHandle.load(PluginHandle.java:95) 
        at com.getcapacitor.PluginHandle.<init>(PluginHandle.java:59) 
        at com.getcapacitor.Bridge.registerPlugin(Bridge.java:503) 
        at com.getcapacitor.Bridge.registerAllPlugins(Bridge.java:458) 
        at com.getcapacitor.Bridge.<init>(Bridge.java:188) 
        at com.getcapacitor.Bridge.<init>(Bridge.java:65) 
        at com.getcapacitor.Bridge$Builder.create(Bridge.java:1288) 
        at com.getcapacitor.BridgeActivity.load(BridgeActivity.java:72) 
        at com.getcapacitor.BridgeActivity.onStart(BridgeActivity.java:110) 
        at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1391) 
        at android.app.Activity.performStart(Activity.java:7157) 
        at android.app.ActivityThread.handleStartActivity(ActivityThread.java:2968) 
        at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180) 
        at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165) 
        at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1836) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:193) 
        at android.app.ActivityThread.main(ActivityThread.java:6702) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911) 

Platform(s):

  • android only

Current behavior:

  • the app crashes right after launch. don't even see splash

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/android: 3.4.3
  @capacitor/core: 3.4.3
  @capacitor/ios: 3.4.3

bug: signInWithGoogle() won't fire

Plugin(s):

"@capacitor-firebase/authentication": "^0.1.1"

Platform(s):

iOS

Current behavior:

const res = await FirebaseAuthentication.signInWithGoogle(); does nothing when it's ran and no error is logged either.
I have added what needs to be added for iOS unless the documentation is missing something.

Expected behavior:

when ran, it should pull up Googles authentication window

Related code:

async googleLogin() {

    try {

        if (this.platform.is('capacitor')) {

            const res = await FirebaseAuthentication.signInWithGoogle();

            const credential = new OAuthProvider('google.com').credential(res.credential);

            await signInWithCredential(this.auth, credential);

          }

    } catch (err) {
        console.log(err);
    }
}

Other information:

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/android: 3.4.3
  @capacitor/cli: 3.4.3
  @capacitor/core: 3.4.3
  @capacitor/ios: 3.4.3

[success] iOS looking great! 👌
[success] Android looking great! 👌

Help: The supplied auth credential is malformed or has expired.

Hi,

I use this Capacitor plugin to Auth with MS. But no luck yet.

I have followed this doc and configured it all well.

But can you tell me where to set this up?

When registering apps with these providers, be sure to register the *.firebaseapp.com domain for your project as the redirect domain for your app.

Error

The supplied auth credential is malformed or has expired. [ Error getting access token from microsoft.com, OAuth2 redirect uri is: https://my-app-123a2.firebaseapp.com/__/auth/handler, response: OAuth2TokenResponse{params: error=invalid_reques

This is an Ionic/Angular Native app on an Android device.

feat: add verifyPhoneNumber

Is your feature request related to a problem? Please describe:
I use two-factor authentication in my app and would love it if you could implement verifyPhoneNumber. I'm not sure if signInWithPhoneNumber would work in this case (I haven't tried it yet);

Describe the solution you'd like:

To be able to generate a verificationId with verifyPhoneNumber.

Describe alternatives you've considered:

I've tried using the firebase sdk and it works on web and Android but iOS won't load the recaptcha needed to verify the phone number and generate the verificationId.

feat(authentication): resend sms verification code

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

Currently it is not possible to request the SMS verification code again.

Describe the solution you'd like:

Add an option to resend the sms verification code.

bug: Failed resolution of: Lcom/facebook/CallbackManager

Plugin(s):

"@capacitor-firebase/authentication": "^0.2.2",
"firebase": "^9.8.1",

Platform(s):

Android, ionic, angular

Current behavior:

I'm using the authentication plugin only for FirebaseAuthentication.signInWithPhoneNumber.
I also only choose phone in providers in capacitor.config.json
"FirebaseAuthentication": {
"skipNativeAuth": false,
"providers": ["phone"]
},
My code is working well in ios, but when I try to run it in Android, I got below error message and the app is close automatically when start.
I didn't use or call any facebook method in my project.

2022-05-11 18:03:48.534 26307-26307/? D/Capacitor: Registering plugin: FirebaseAuthentication 2022-05-11 18:03:48.546 26307-26307/? D/AndroidRuntime: Shutting down VM 2022-05-11 18:03:48.548 26307-26307/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.xxxx.xxxxxx, PID: xxxxxx java.lang.NoClassDefFoundError: Failed resolution of: Lcom/facebook/CallbackManager$Factory; at dev.robingenz.capacitorjs.plugins.firebase.authentication.handlers.FacebookAuthProviderHandler.<init>(FacebookAuthProviderHandler.java:30) at dev.robingenz.capacitorjs.plugins.firebase.authentication.FirebaseAuthentication.initAuthProviderHandlers(FirebaseAuthentication.java:389) at dev.robingenz.capacitorjs.plugins.firebase.authentication.FirebaseAuthentication.<init>(FirebaseAuthentication.java:51) at dev.robingenz.capacitorjs.plugins.firebase.authentication.FirebaseAuthenticationPlugin.load(FirebaseAuthenticationPlugin.java:38) at com.getcapacitor.PluginHandle.load(PluginHandle.java:95)

Expected behavior:

The application should be able to run.

Steps to reproduce:

Install the package, npm i @capacitor-firebase/authentication
Then setup for phone authentication only.

Related code:

insert short code snippets here

Other information:

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.4.3    
  @capacitor/core: 3.4.3   
  @capacitor/ios: 3.4.3    
  @capacitor/android: 3.5.0

[success] Android looking great! 👌
[error] Xcode is not installed

bug: Analytics - Error building iOS App

Plugin(s):

@capacitor-firebase/analytics
version: 0.2.1

Platform(s):
iOS

Current behavior:
During the iOS App build process, we are getting this error No such module 'FirebaseCore' from FirebaseAnalytics.swift

Expected behavior:
iOS builds without error

Steps to reproduce:

Created a sample ionic react project with analytics plugin as a dependency. This can be viewed here - https://codesandbox.io/s/quirky-nova-vpymls

This is basic ionic react template and the iOS project is synced with the plugin. After trying to build from this iOS project, we are getting the build error

No such module 'FirebaseCore'

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/core: 3.4.1
  @capacitor/android: 3.4.0
  @capacitor/ios: 3.4.0
  @capacitor/cli: 3.4.1

bug(authentication): Facebook login accessToken is undefined

Plugin version:

@robingenz/capacitor-firebase-authentication ^0.4.1

Platform(s):

Android
iOS

Current behavior:

Facebook sign in is successfully done when calling signInWithFacebook() but the result is an object of {prodvider: ... , idToken: ...}
and there is no accessToken returned in the result which is needed to link native layer with JS sdk by calling signInWithCredintials()
described here

Expected behavior:

accessToken returned in signinWithFacebook() result to use it in JS sdk signin

Steps to reproduce:

Related code:

  const result = await FirebaseAuthentication.signInWithFacebook();
  const credential = FacebookAuthProvider.credential(result.credential?.accessToken);
  const auth = getAuth();
  await signInWithCredential(auth, credential);

Other information:

Capacitor doctor:

Latest Dependencies:

  @capacitor/cli: 3.4.1
  @capacitor/core: 3.4.1
  @capacitor/android: 3.4.1
  @capacitor/ios: 3.4.1

Installed Dependencies:

  @capacitor/cli: 3.4.1
  @capacitor/core: 3.4.1
  @capacitor/android: 3.4.1
  @capacitor/ios: 3.4.1

[success] Android looking great! 👌
[error] Xcode is not installed

bug: Basic config not returning token to app

Plugin(s):

This is an Ionic-Capacitor app using Vue3 and Firebase Auth (only google)

Platform(s):

IOS specifically

Current behavior:

When deploying app and attempting login, the Native popup allows login, but the logfile shows the token being passed into the JS but the app is not updated as is expected

IonicError

Expected behavior:

The expected behavour is that the user's Display Name is populated above the "Start with Ionic" banner

Steps to reproduce:

Bare Ionic app created with core functionality

Related code:

I have created a stub with only google auth in the following Repo
https://github.com/sclawer/MobileApp.git

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/android: 3.4.3
@capacitor/core: 3.4.3
@capacitor/ios: 3.4.3

[success] iOS looking great! 👌
[success] Android looking great! 👌

Problem with a new version of IOS - Illformed requirement $IOS_FIREBASE_POD_VERSION

Report

What did you do?

Run capacitor sync ios" generate a new version of ios pod install

What did you expect to happen?

Install all pod dependencies correctly.

What happened instead?

Pod installation error

CocoaPods Environment

ℹ Please replace these two lines with the output of pod env.

Project that demonstrates the issue

[capacitor]
[capacitor] Command
[capacitor]
[capacitor] [capacitor] /usr/local/bin/pod install [capacitor]
[capacitor]
[capacitor] Stack
[capacitor]
[capacitor] [capacitor] CocoaPods : 1.11.2 [capacitor] Ruby : ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.x86_64-darwin21] [capacitor] RubyGems : 3.0.3.1 [capacitor] Host : macOS 12.2.1 (21D62) [capacitor] Xcode : 13.2.1 (13C100) [capacitor] Git : git version 2.32.0 (Apple Git-132) [capacitor] Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib [capacitor] Repositories : trunk - CDN - https://cdn.cocoapods.org/ [capacitor]
[capacitor]
[capacitor] Plugins
[capacitor]
[capacitor] [capacitor] cocoapods-deintegrate : 1.0.5 [capacitor] cocoapods-plugins : 1.0.0 [capacitor] cocoapods-search : 1.0.1 [capacitor] cocoapods-trunk : 1.6.0 [capacitor] cocoapods-try : 1.2.0 [capacitor]
[capacitor]
[capacitor] Podfile
[capacitor]
[capacitor] ruby [capacitor] platform :ios, '11.0' [capacitor] use_frameworks! [capacitor] [capacitor] # workaround to avoid Xcode caching of Pods that requires [capacitor] # Product -> Clean Build Folder after new Cordova plugins installed [capacitor] # Requires CocoaPods 1.6 or newer [capacitor] install! 'cocoapods', :disable_input_output_paths => true [capacitor] [capacitor] def capacitor_pods [capacitor] # Automatic Capacitor Pod dependencies, do not delete [capacitor] pod 'Capacitor', :path => '../../node_modules/@capacitor/ios' [capacitor] pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios' [capacitor] pod 'CapacitorCommunityFirebaseAnalytics', :path => '../../node_modules/@capacitor-community/firebase-analytics' [capacitor] pod 'RobingenzCapacitorFirebaseAuthentication', :path => '../../node_modules/@robingenz/capacitor-firebase-authentication' [capacitor] pod 'CordovaPluginsStatic', :path => '../capacitor-cordova-ios-plugins' [capacitor] # Do not delete [capacitor] end [capacitor] [capacitor] target 'App' do [capacitor] capacitor_pods [capacitor] # Add your Pods here [capacitor] end [capacitor]
[capacitor]
[capacitor] Error
[capacitor]
[capacitor] ```
[capacitor] ArgumentError - Illformed requirement "$IOS_FIREBASE_POD_VERSION"
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/requirement.rb:63:in `parse'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/requirement.rb:88:in `block in initialize'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/requirement.rb:88:in `map!'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/requirement.rb:88:in `initialize'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/requirement.rb:34:in `new'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/requirement.rb:34:in `create'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/dependency.rb:101:in `initialize'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/specification/consumer.rb:233:in `new'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/specification/consumer.rb:233:in `block in dependencies'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/specification/consumer.rb:232:in `each'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/specification/consumer.rb:232:in `map'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/specification/consumer.rb:232:in `dependencies'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/specification.rb:403:in `block in dependencies'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/specification.rb:402:in `map'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/specification.rb:402:in `dependencies'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/validator.rb:44:in `initialize'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/external_sources/abstract_external_source.rb:201:in `new'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/external_sources/abstract_external_source.rb:201:in `validator_for_podspec'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/external_sources/abstract_external_source.rb:186:in `validate_podspec'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/external_sources/abstract_external_source.rb:178:in `store_podspec'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/external_sources/path_source.rb:17:in `block in fetch'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/external_sources/path_source.rb:11:in `fetch'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:993:in `fetch_external_source'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:972:in `block (2 levels) in fetch_external_sources'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:971:in `each'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:971:in `block in fetch_external_sources'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:970:in `fetch_external_sources'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:117:in `analyze'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:416:in `analyze'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:161:in `install!'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command/install.rb:52:in `run'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
[capacitor] /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
[capacitor] /usr/local/bin/pod:23:in `load'
[capacitor] /usr/local/bin/pod:23:in `

'

feat(authentication): support OAuth 2.0 scopes

Is your feature request related to a problem? Please describe.
Firebase Authentication allows to specify additional OAuth 2.0 scopes. This is currently not possible with this plugin.

Describe the solution you'd like
Add support for OAuth 2.0 scopes.

feat: support Firebase Performance Monitoring

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

Firebase Performance Monitoring is not currently supported.

Describe the solution you'd like:

Add a Firebase Performance Monitoring plugin.

Describe alternatives you've considered:

Additional context:

Error: `Unable to process request due to missing initial state.`

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

There's currently an issue with the authentication flow where in some cases upon calling the Callback URL (default myapp.firebaseapp.com/__/auth/handler provided by Firebase) the external browser will show this error:
"Unable to process request due to missing initial state. This may happen if browser sessionStorage is inaccessible or accidentally cleared."

There's a GitHub issue open for this: firebase/firebase-js-sdk#4256

From my own testing and troubleshooting I've concluded that in my experience this only happens with mobile Firefox. However, if we go to Firefox advanced settings and toggle "Open Links in App" to on, then the authentication proceeds as normal by redirecting back to the Capacitor app. Other browsers tested such as Chrome, Brave and Samsung Internet all work normally.

This leads me to believe that if force the authentication to open in a WebView, then we normalize the experience for all users, regardless of what their default web browser is set to.

Describe the solution you'd like:

If possible, force (or as configurable option) the authentication flow to go through @capacitor/browser instead of an external browser.

Additional context:

I'm unsure if the solution belongs to this plugin, but I thought this was a good place to start. Any advice appreciated!

feat: SignInWithGoogle AuthCredential accessToken undefined

I am using

FirebaseAuthentication.signInWithGoogle()

Which return both User and AuthCredential. Under AuthCredential I am not getting oAuth access token. I am only getting providerId and idToken.

I would like to use oAuth access token to call REST API of google photo library (https://photoslibrary.googleapis.com/v1/albums). But When I console.log SignInResult.AuthCredential.accessToken its undefined.

How plugin chose its OIDC provider or OAuth provider. Can we set provider in this plugin ?

I test it on iOS device.

feat: support Firebase Remote Config

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

Firebase Remote Config is not currently supported.

Describe the solution you'd like:

Add a Firebase Remote Config plugin.

Describe alternatives you've considered:

Additional context:

feat(authentication): password authentication

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

You can use Firebase Authentication to let your users authenticate with Firebase using their email addresses and passwords (password-auth). This is currently not possible with this plugin.

Describe the solution you'd like:

Add support for password authentication.

  • createUserWithEmailAndPassword
  • signInWithEmailAndPassword
  • updateEmail
  • sendEmailVerification
  • sendPasswordResetEmail
  • updatePassword

Describe alternatives you've considered:

No alternative solutions.

bug: wrong typescript definitions

Plugin(s):

  • "@capacitor-firebase/messaging": "0.2.2"

Wrong types:

export interface NotificationActionPerformedEvent {
    /**
     * The action performed on the notification.
     *
     * @since 0.2.2
     */
    actionId: Notification;
    /**
     * Text entered on the notification action.
     *
     * Only available on iOS.
     *
     * @since 0.2.2
     */
    inputValue: Notification;
    /**
     * The notification in which the action was performed.
     *
     * @since 0.2.2
     */
    notification: Notification;
}

feat: support Firebase Cloud Messaging

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

Firebase Cloud Messaging is not currently supported.

Describe the solution you'd like:

Add a Firebase Cloud Messaging plugin.

Describe alternatives you've considered:

Additional context:

feat: improve error handling

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

Error messages are currently poorly described and have no unique, uniform error codes.
This complicates cross-platform error handling.

Describe the solution you'd like:

The error messages should contain a helpful message and a unique code.

Describe alternatives you've considered:

No alternative solutions.

Additional context:

https://stackoverflow.com/questions/37859582/how-to-catch-a-firebase-auth-specific-exceptions

bug: ERROR Error: Uncaught (in promise): Error: 10 : Google Sign In - Android device

Hi,

I have followed your demo app and done all the configurations as per your docs. When I push the app to a Native Android device using this CLI it shows the below error on the console. It opens the Sign In popup and I have selected my Gmail a/C there. After that below error. Any clue, please.

ionic cap run android -l --host=0.0.0.0

I have tried with Android studio too. But the same error:

 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
main.5dfd8e110055e9fe.js:1 ERROR Error: Uncaught (in promise): Error: 10: 
Error: 10: 
    at Object.cap.fromNative (VM3:411:32)
    at <anonymous>:1:18
    at A (polyfills.399b2c612e14986c.js:1:17320)
    at polyfills.399b2c612e14986c.js:1:16402
    at Ie (main.5dfd8e110055e9fe.js:1:195570)
    at h.invoke (polyfills.399b2c612e14986c.js:1:7321)
    at Object.onInvoke (main.5dfd8e110055e9fe.js:1:336317)
    at h.invoke (polyfills.399b2c612e14986c.js:1:7261)
    at h.run (polyfills.399b2c612e14986c.js:1:2414)
    at polyfills.399b2c612e14986c.js:1:18126
    at h.invokeTask (polyfills.399b2c612e14986c.js:1:8006)
    at Object.onInvokeTask (main.5dfd8e110055e9fe.js:1:336133)
D_ @ main.5dfd8e110055e9fe.js:1
handleError @ main.5dfd8e110055e9fe.js:1
next @ main.5dfd8e110055e9fe.js:1
__tryOrUnsub @ main.5dfd8e110055e9fe.js:1
next @ main.5dfd8e110055e9fe.js:1
_next @ main.5dfd8e110055e9fe.js:1
next @ main.5dfd8e110055e9fe.js:1
next @ main.5dfd8e110055e9fe.js:1
emit @ main.5dfd8e110055e9fe.js:1
(anonymous) @ main.5dfd8e110055e9fe.js:1
h.invoke @ polyfills.399b2c612e14986c.js:1
h.run @ polyfills.399b2c612e14986c.js:1
runOutsideAngular @ main.5dfd8e110055e9fe.js:1
onHandleError @ main.5dfd8e110055e9fe.js:1
h.handleError @ polyfills.399b2c612e14986c.js:1
h.runGuarded @ polyfills.399b2c612e14986c.js:1
f @ polyfills.399b2c612e14986c.js:1
t.microtaskDrainDone @ polyfills.399b2c612e14986c.js:1
m @ polyfills.399b2c612e14986c.js:1
Promise.then (async)
g @ polyfills.399b2c612e14986c.js:1
h.scheduleTask @ polyfills.399b2c612e14986c.js:1
onScheduleTask @ polyfills.399b2c612e14986c.js:1
h.scheduleTask @ polyfills.399b2c612e14986c.js:1
h.scheduleTask @ polyfills.399b2c612e14986c.js:1
h.scheduleMicroTask @ polyfills.399b2c612e14986c.js:1
H @ polyfills.399b2c612e14986c.js:1
A @ polyfills.399b2c612e14986c.js:1
(anonymous) @ polyfills.399b2c612e14986c.js:1
cap.fromNative @ VM3:428
(anonymous) @ VM39:1

bug(authentication): NPR reported by Firebase Crashlytics

Plugin version:
0.3.11
^ Will update to the latest and update if no longer occurring.

Platform(s):
Reported on: ASUS_Z012DC

Current behavior:
Can't reproduce the bug so far, working from a crashlytics report.

Other information:

Fatal Exception: java.lang.NullPointerException
Attempt to invoke virtual method 'void com.getcapacitor.PluginCall.resolve(com.getcapacitor.JSObject)' on a null object reference
dev.robingenz.capacitorjs.plugins.firebase.auth.FirebaseAuthentication$3.onComplete (FirebaseAuthentication.java:185)
com.google.android.gms.tasks.zzj.run (Unknown Source:4)
android.os.Handler.handleCallback (Handler.java:789)
android.os.Handler.dispatchMessage (Handler.java:98)
android.os.Looper.loop (Looper.java:169)
android.app.ActivityThread.main (ActivityThread.java:6578)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:240)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:767)

feat: support Firebase Local Emulator

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

Firebase Local Emulator is not currently supported.

Describe the solution you'd like:

iOS

#if DEBUG
     Auth.auth().useEmulator(withHost:config.devIP, port:9099)
#endif

Android

String devIP = this.config.getDevIP();

if(BuildConfig.DEBUG) {
     FirebaseAuth.getInstance().useEmulator(devIP, 9099);
}

com.google.firebase.auth.FirebaseAuthInvalidCredentialsException: The sms code has expired. Please re-send the verification code to try again.

the problem is This authentication happens in the background while the user still receives the verification code in an SMS. When the user tries to enter the verification code, i gets message that the verification code expired

V/Capacitor/FirebaseAuthenticationPlugin: Notifying listeners for event authStateChange
D/Capacitor/FirebaseAuthenticationPlugin: No listeners found for event authStateChange

E/FirebaseAuthentication: signInWithCredential failed.
com.google.firebase.auth.FirebaseAuthInvalidCredentialsException: The sms code has expired. Please re-send the verification code to try again.

how can i avoid receiving the verification code expiry message, and how can i set up a listener for " authentication changes ." in vuejs??

please help!

bug: java.lang.UnsupportedClassVersionError

Plugin(s):

"@capacitor-firebase/performance": "^0.2.1"
"firebase": "^9.6.11"
"@angular/core": "^13.1.0"
"@capacitor/core": "^3.4.0"
"@ionic/angular": "^6.0.0"

Platform(s):

Android

Current behavior:

While building android project getting below build error;
A problem occurred evaluating project ':app'.

java.lang.UnsupportedClassVersionError: com/google/firebase/perf/plugin/FirebasePerfPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Expected behavior:

Build Successful.

Steps to reproduce:

Related code:

build.gradle(app)

apply plugin: 'com.android.application'

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    defaultConfig {
        applicationId "com.example.demoapp"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdk rootProject.ext.targetSdkVersion
        versionCode 11
        versionName '1.1.'
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        aaptOptions {
             // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
             // Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
            ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
        }
      versionNameSuffix '1'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          signingConfig signingConfigs.release
        }
    }
}

repositories {
    flatDir{
        dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
    implementation project(':capacitor-android')
    testImplementation "junit:junit:$junitVersion"
    androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
    androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
    implementation project(':capacitor-cordova-android-plugins')
    //google 
    implementation 'com.google.android.play:core:1.10.3'

    // Import the BoM for the Firebase platform
    implementation platform('com.google.firebase:firebase-bom:29.3.1')
    implementation 'com.google.firebase:firebase-crashlytics'
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.google.firebase:firebase-perf'
}

apply from: 'capacitor.build.gradle'

try {
    def servicesJSON = file('google-services.json')
    if (servicesJSON.text) {
        apply plugin: 'com.google.gms.google-services'
        apply plugin: 'com.google.firebase.firebase-perf' // Firebase Performance Monitoring plugin
        apply plugin: 'com.google.firebase.crashlytics' // Firebase Crashlytics plugin
        //apply plugin: 'com.google.firebase.analytics' // Firebase Analytics plugin
    }
} catch(Exception e) {
    logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
}

build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.2.1'
        classpath 'com.google.gms:google-services:4.3.5'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        // Add the Crashlytics Gradle plugin
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
        classpath 'com.google.firebase:perf-plugin:1.4.1' // Performance Gradle plugin
    }
}

apply from: "variables.gradle"

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Other information:

Capacitor doctor:

💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 3.5.0
  @capacitor/core: 3.5.0
  @capacitor/android: 3.5.0
  @capacitor/ios: 3.5.0

Installed Dependencies:

  @capacitor/ios: not installed
  @capacitor/core: 3.4.0
  @capacitor/cli: 3.3.3
  @capacitor/android: 3.4.1

[success] Android looking great! 👌

self authentication on android

Hi
I had a problem with Android.
As soon as the SMS reaches the device, it performs native authentication behind the scenes,
And afterwards I can't authenticate to web layer JS SDK, because the OTP expired.
Is there a way to proceed with web authentication?

Thank you

bug: Calling FirebaseAuthentication.getIdToken() before auth'd causes fatal error & app crashes

Plugin(s):

authentication 0.21

Platform(s):

Android

Current behavior:

call FirebaseAuthentication.getIdToken() from the JS client before an ID token exists in the Native cache.

E/Capacitor: Serious error executing plugin
    java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invoke(Native Method)
        at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:121)
        at com.getcapacitor.Bridge.lambda$callPluginMethod$0$com-getcapacitor-Bridge(Bridge.java:592)
        at com.getcapacitor.Bridge$$ExternalSyntheticLambda5.run(Unknown Source:8)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:193)
        at android.os.HandlerThread.run(HandlerThread.java:65)
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.auth.FirebaseUser.getIdToken(boolean)' on a null object reference
        at dev.robingenz.capacitorjs.plugins.firebase.authentication.FirebaseAuthentication.getIdToken(FirebaseAuthentication.java:79)
        at dev.robingenz.capacitorjs.plugins.firebase.authentication.FirebaseAuthenticationPlugin.getIdToken(FirebaseAuthenticationPlugin.java:43)
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:121) 
        at com.getcapacitor.Bridge.lambda$callPluginMethod$0$com-getcapacitor-Bridge(Bridge.java:592) 
        at com.getcapacitor.Bridge$$ExternalSyntheticLambda5.run(Unknown Source:8) 
        at android.os.Handler.handleCallback(Handler.java:873) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at android.os.Looper.loop(Looper.java:193) 
        at android.os.HandlerThread.run(HandlerThread.java:65) 
E/AndroidRuntime: FATAL EXCEPTION: CapacitorPlugins
    Process: com.maritlabs.topdecked.mtg, PID: 17988
    java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
        at com.getcapacitor.Bridge.lambda$callPluginMethod$0$com-getcapacitor-Bridge(Bridge.java:601)
        at com.getcapacitor.Bridge$$ExternalSyntheticLambda5.run(Unknown Source:8)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:193)
        at android.os.HandlerThread.run(HandlerThread.java:65)
     Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invoke(Native Method)
        at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:121)
        at com.getcapacitor.Bridge.lambda$callPluginMethod$0$com-getcapacitor-Bridge(Bridge.java:592)
        at com.getcapacitor.Bridge$$ExternalSyntheticLambda5.run(Unknown Source:8) 
        at android.os.Handler.handleCallback(Handler.java:873) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at android.os.Looper.loop(Looper.java:193) 
        at android.os.HandlerThread.run(HandlerThread.java:65) 
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.auth.FirebaseUser.getIdToken(boolean)' on a null object reference
        at dev.robingenz.capacitorjs.plugins.firebase.authentication.FirebaseAuthentication.getIdToken(FirebaseAuthentication.java:79)
        at dev.robingenz.capacitorjs.plugins.firebase.authentication.FirebaseAuthenticationPlugin.getIdToken(FirebaseAuthenticationPlugin.java:43)

Expected behavior:

Don't crash :) Just return null.

Steps to reproduce:

  1. Install a fresh build of an app.
  2. Don't authenticate.
  3. Call FirebaseAuthentication.getIdToken()

Related code:

insert short code snippets here

Other information:

Capacitor doctor:

mshark:topdecked-unified lincoln$ npx cap 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/ios: 3.4.3
  @capacitor/android: 3.4.3
  @capacitor/core: 3.4.3

[success] iOS looking great! 👌
[success] Android looking great! 👌
mshark:topdecked-unified lincoln$ 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.