-
I am currently signing a user in via Apple. Based on this answer I have to configure async signInWithApple() {
const result = await FirebaseAuthentication.signInWithApple({
scopes: ['name', 'email'],
skipNativeAuth: true, // doesn't stay logged in to link later
});
const provider = new OAuthProvider('apple.com');
provider.addScope('name');
provider.addScope('email');
const credential = provider.credential({
idToken: result.credential?.idToken,
rawNonce: result.credential?.nonce,
});
const userCredential = await signInWithCredential(this.auth, credential);
return userCredential;
} I then later want to be able to link a Facebook login to the user; mostly to pull shared friends. When I use the linkWithFacebook functionality after signing in via Apple, there is no user on the native layer and so I get a Here's the facebook link method: async linkWithFacebook() {
console.log(await FirebaseAuthentication.getCurrentUser());
const result = await FirebaseAuthentication.linkWithFacebook({
scopes: [ 'public_profile', 'user_friends' ],
});
return result;
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
No, unfortunately this is not possible. If you want to use the |
Beta Was this translation helpful? Give feedback.
No, unfortunately this is not possible. If you want to use the
linkWithFacebook()
method, you have to sign in the user on the native layer. The configuration optionskipNativeAuth
was originally introduced because there were no Capacitor plugins for the other Firebase SDKs. In the meantime, however, there is a Capacitor plugin for almost every Firebase SDK so that the use ofskipNativeAuth
should only be necessary in rare cases.