Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions packages/firebase-auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,13 @@ import { LoginManager, AccessToken } from '@nativescript/facebook';

LoginManager.logInWithPermissions(['public_profile', 'email']).then((result) => {
// Once signed in, get the users AccesToken
const data = await AccessToken.getCurrentAccessToken();
const data = await AccessToken.currentAccessToken();

// Create a Firebase credential with the AccessToken
const facebookCredential = FacebookAuthProvider.credential(data.accessToken);
const facebookCredential = FacebookAuthProvider.credential(data.tokenString);

// Sign-in the user with the credential
return auth().signInWithCredential(facebookCredential);

firebase().auth().signInWithCredential(facebookAuthCredential);
return firebase().auth().signInWithCredential(facebookCredential);
});


Expand Down Expand Up @@ -227,7 +225,7 @@ import { GoogleSignin } from '@nativescript/google-signin';
GoogleSignin.configure(); // called earlier in the app

GoogleSignin.signIn().then((user) => {
const credential = GoogleAuthProvider.credential(user.accessToken, user.idToken);
const credential = GoogleAuthProvider.credential(user.idToken, user.accessToken);

firebase().auth().signInWithCredential(credential);
});
Expand Down
4 changes: 2 additions & 2 deletions packages/firebase-messaging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This module provides a requestPermission method which triggers a native permissi

```ts
import { firebase } from '@nativescript/firebase-core';
import '@nativescript/firebase-crashlytics'; // only needs to be imported 1x
import '@nativescript/firebase-messaging'; // only needs to be imported 1x

async function requestUserPermission() {
const authStatus = await firebase()
Expand Down Expand Up @@ -263,7 +263,7 @@ async function saveTokenToDatabase(token) {


// Listen to whether the token changes
firebase().messaging().onTokenRefresh(token => {
firebase().messaging().onToken(token => {
saveTokenToDatabase(token);

}
Expand Down