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": { | |
"clientId": "YOUR_APP_CLIENT_ID", | |
"secret": "YOUR_APP_SECRET" | |
} | |
} |
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/.gitignore | |
settings.json |
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/client/index.html --> | |
<head> | |
<title>MeteorApp</title> | |
</head> | |
<body> | |
<h1>Welcome to Meteor!</h1> | |
{{> loginButtons}} | |
</body> |
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
// In RNApp/app/ddp.js | |
/* | |
* Removed from snippet for brevity | |
*/ | |
ddpClient.signUpWithEmail = (email, password, cb) => { | |
let params = { | |
email: email, | |
password: ddpClient.sha256(password) |
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
// In RNApp/app/ddp.js | |
/* | |
* Removed from snippet for brevity | |
*/ | |
ddpClient.sha256 = (password) => { | |
return { | |
digest: hash.sha256().update(password).digest('hex'), | |
algorithm: "sha-256" |
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
// In RNApp/app/ddp.js | |
import DDPClient from 'ddp-client'; | |
import hash from 'hash.js'; | |
import { AsyncStorage } from 'react-native'; | |
let ddpClient = new DDPClient({ | |
host: 'localhost', | |
port: '3000', | |
// url: <your websocket url> | |
}); |
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
<!-- In /meteor-app/client/home.html --> | |
<template name="home"> | |
{{> loginButtons}} | |
<h1>Post Count: {{count}}</h1> | |
<button id="increment">Increment</button> | |
<button id="decrement">Decrement</button> | |
</template> |
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
// meteor-app/both/posts.js | |
'addPost': function() { | |
Posts.insert({ | |
title: 'Post ' + Random.id(), | |
userId: this.userId | |
}); | |
}, |
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/loggedOut.js | |
import React, { | |
View, | |
Text, | |
TextInput, | |
StyleSheet, | |
AsyncStorage // Import AsyncStorage | |
} from 'react-native'; |