This file contains 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
// MeteorApp/server/google-oauth.js | |
const settings = Meteor.settings.google; | |
if (settings) { | |
ServiceConfiguration.configurations.remove({ | |
service: 'google' | |
}); | |
ServiceConfiguration.configurations.insert({ |
This file contains 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
/* MeteorApp/settings.json */ | |
{ | |
"google": { | |
"client_secret": "MY_WEB_APP_SECRET", | |
"client_id": "MY_WEB_APP_CLIENT_ID", | |
"validClientIds": [ | |
"MY_WEB_APP_CLIENT_ID", | |
"MY_IOS_APP_CLIENT_ID" | |
] |
This file contains 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
// RNApp/app/containers/signOut.js | |
import { GoogleSignin } from 'react-native-google-signin'; | |
/* | |
Removed for brevity | |
*/ | |
handleSignOut() { | |
// ddpClient.logout(() => { | |
// this.props.changedSignedIn(false); |
This file contains 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
// RNApp/app/containers/signIn.js | |
componentWillReceiveProps(nextProps) { | |
if (nextProps) { | |
GoogleSignin.currentUserAsync() | |
.then((user) => { | |
this.handleDDPSignIn(user) | |
}) | |
.done(); | |
} |
This file contains 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
// RNApp/app/containers/signIn.js | |
handleDDPSignIn(googleUser) { | |
if (googleUser) { | |
this.props.changedSignedIn(true); | |
} | |
} | |
/* | |
Removed for brevity |
This file contains 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
// RNApp/app/containers/signIn.js | |
button = <Button text="Sign In with Google" onPress={this.handleGoogleSignIn.bind(this)} />; |
This file contains 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
// RNApp/app/containers/signIn.js | |
import { GoogleSignin } from 'react-native-google-signin'; | |
/* | |
Removed for brevity | |
*/ | |
handleGoogleSignIn() { | |
GoogleSignin.signIn() | |
.then((user) => { |
This file contains 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, { | |
Component, | |
StyleSheet, | |
Text, | |
View | |
} from 'react-native'; | |
import Button from '../components/button'; | |
import ddpClient from '../ddp'; |
This file contains 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
// RNApp/app/index.js | |
import config from './config'; | |
import { GoogleSignin } from 'react-native-google-signin'; | |
/* | |
Removed for brevity | |
*/ | |
componentWillMount() { | |
GoogleSignin.configure({ |
This file contains 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
let opts = { | |
env: 'dev', // ['dev', 'staging', 'prod'] | |
// codePushDeploymentKey: '', | |
ddpConfig: { | |
maintainCollections : true, | |
}, | |
google: { | |
iosClientId: 'XYZ_YOUR_CLIENT_ID.apps.googleusercontent.com' | |
} | |
} |