File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -162,15 +162,13 @@ import { LoginManager, AccessToken } from '@nativescript/facebook';
162162
163163LoginManager .logInWithPermissions ([' public_profile' , ' email' ]).then ((result ) => {
164164 // Once signed in, get the users AccesToken
165- const data = await AccessToken .getCurrentAccessToken ();
165+ const data = await AccessToken .currentAccessToken ();
166166
167167 // Create a Firebase credential with the AccessToken
168- const facebookCredential = FacebookAuthProvider .credential (data .accessToken );
168+ const facebookCredential = FacebookAuthProvider .credential (data .tokenString );
169169
170170 // Sign-in the user with the credential
171- return auth ().signInWithCredential (facebookCredential );
172-
173- firebase ().auth ().signInWithCredential (facebookAuthCredential );
171+ return firebase ().auth ().signInWithCredential (facebookCredential );
174172});
175173
176174
@@ -227,7 +225,7 @@ import { GoogleSignin } from '@nativescript/google-signin';
227225GoogleSignin .configure (); // called earlier in the app
228226
229227GoogleSignin .signIn ().then ((user ) => {
230- const credential = GoogleAuthProvider .credential (user .accessToken , user .idToken );
228+ const credential = GoogleAuthProvider .credential (user .idToken , user .accessToken );
231229
232230 firebase ().auth ().signInWithCredential (credential );
233231});
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ This module provides a requestPermission method which triggers a native permissi
2222
2323``` ts
2424import { firebase } from ' @nativescript/firebase-core' ;
25- import ' @nativescript/firebase-crashlytics ' ; // only needs to be imported 1x
25+ import ' @nativescript/firebase-messaging ' ; // only needs to be imported 1x
2626
2727async function requestUserPermission() {
2828 const authStatus = await firebase ()
@@ -263,7 +263,7 @@ async function saveTokenToDatabase(token) {
263263
264264
265265 // Listen to whether the token changes
266- firebase ().messaging ().onTokenRefresh (token => {
266+ firebase ().messaging ().onToken (token => {
267267 saveTokenToDatabase (token );
268268
269269}
You can’t perform that action at this time.
0 commit comments