This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <Firebase.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| target 'ExampleApp' do | |
| config = use_native_modules! | |
| use_frameworks! :linkage => :static | |
| $RNFirebaseAsStaticFramework = true | |
| ... | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import {Text, TouchableOpacity, Image, View} from 'react-native'; | |
| const App = () => { | |
| return ( | |
| <View> | |
| <TouchableOpacity onPress={onGoogleButtonPress}> | |
| <View> | |
| <Image source={images.googleIcon} /> | |
| </View> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function onGoogleButtonPress() { | |
| try { | |
| // Get the user's ID token | |
| const { idToken } = await GoogleSignin.signIn(); | |
| // Create a Google credential with the token | |
| const googleCredential = auth.GoogleAuthProvider.credential(idToken); | |
| // Sign-in the user with the credential | |
| return auth().signInWithCredential(googleCredential); | |
| } catch (error) { | |
| if (error.code === statusCodes.SIGN_IN_CANCELLED) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {GoogleSignin} from '@react-native-google-signin/google-signin'; | |
| import auth from '@react-native-firebase/auth'; | |
| const _signInWithGoogle = async () => { | |
| try { | |
| GoogleSignin.configure({ | |
| offlineAccess: false, | |
| webClientId: | |
| 'YOUR_WEB_CLIENT_ID', | |
| scopes: ['profile', 'email'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pod install --repo-update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <meta-data | |
| android:name="com.google.android.gms.auth.api.credentials.ClientId" | |
| android:value="YOUR_WEB_CLIENT_ID" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pod 'Firebase/Auth' | |
| pod 'GoogleSignIn' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apply plugin: 'com.google.gms.google-services' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| buildscript { | |
| .......... | |
| ... | |
| dependencies { | |
| ........ | |
| classpath 'com.google.gms:google-services:4.3.3' | |
| ........ | |
| } | |
| } |
NewerOlder