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';
162
162
163
163
LoginManager .logInWithPermissions ([' public_profile' , ' email' ]).then ((result ) => {
164
164
// Once signed in, get the users AccesToken
165
- const data = await AccessToken .getCurrentAccessToken ();
165
+ const data = await AccessToken .currentAccessToken ();
166
166
167
167
// Create a Firebase credential with the AccessToken
168
- const facebookCredential = FacebookAuthProvider .credential (data .accessToken );
168
+ const facebookCredential = FacebookAuthProvider .credential (data .tokenString );
169
169
170
170
// Sign-in the user with the credential
171
- return auth ().signInWithCredential (facebookCredential );
172
-
173
- firebase ().auth ().signInWithCredential (facebookAuthCredential );
171
+ return firebase ().auth ().signInWithCredential (facebookCredential );
174
172
});
175
173
176
174
@@ -227,7 +225,7 @@ import { GoogleSignin } from '@nativescript/google-signin';
227
225
GoogleSignin .configure (); // called earlier in the app
228
226
229
227
GoogleSignin .signIn ().then ((user ) => {
230
- const credential = GoogleAuthProvider .credential (user .accessToken , user .idToken );
228
+ const credential = GoogleAuthProvider .credential (user .idToken , user .accessToken );
231
229
232
230
firebase ().auth ().signInWithCredential (credential );
233
231
});
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
22
22
23
23
``` ts
24
24
import { 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
26
26
27
27
async function requestUserPermission() {
28
28
const authStatus = await firebase ()
@@ -263,7 +263,7 @@ async function saveTokenToDatabase(token) {
263
263
264
264
265
265
// Listen to whether the token changes
266
- firebase ().messaging ().onTokenRefresh (token => {
266
+ firebase ().messaging ().onToken (token => {
267
267
saveTokenToDatabase (token );
268
268
269
269
}
You can’t perform that action at this time.
0 commit comments