adding in functionality for menu, disabling ad space for now, and deplying config
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"hostType": "tunnel",
|
||||||
|
"lanType": "ip",
|
||||||
|
"dev": true,
|
||||||
|
"minify": false,
|
||||||
|
"urlRandomness": null
|
||||||
|
}
|
||||||
@@ -116,10 +116,21 @@ android {
|
|||||||
include "armeabi-v7a", "x86"
|
include "armeabi-v7a", "x86"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
|
||||||
|
storeFile file(MYAPP_RELEASE_STORE_FILE)
|
||||||
|
storePassword MYAPP_RELEASE_STORE_PASSWORD
|
||||||
|
keyAlias MYAPP_RELEASE_KEY_ALIAS
|
||||||
|
keyPassword MYAPP_RELEASE_KEY_PASSWORD
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled enableProguardInReleaseBuilds
|
minifyEnabled enableProguardInReleaseBuilds
|
||||||
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
||||||
|
signingConfig signingConfigs.release
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// applicationVariants are e.g. debug, release
|
// applicationVariants are e.g. debug, release
|
||||||
|
|||||||
@@ -18,3 +18,8 @@
|
|||||||
# org.gradle.parallel=true
|
# org.gradle.parallel=true
|
||||||
|
|
||||||
android.useDeprecatedNdk=true
|
android.useDeprecatedNdk=true
|
||||||
|
|
||||||
|
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
|
||||||
|
MYAPP_RELEASE_KEY_ALIAS=my-key-alias
|
||||||
|
MYAPP_RELEASE_STORE_PASSWORD=nextoapp
|
||||||
|
MYAPP_RELEASE_KEY_PASSWORD=nextoapp
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Nexto",
|
"name": "Nexto",
|
||||||
"displayName": "Nexto"
|
"displayName": "Nexto",
|
||||||
}
|
"android": {
|
||||||
|
"package": "com.nexto.nexto"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
+4
-2
@@ -69,7 +69,9 @@ export default class Main extends Component<Props> {
|
|||||||
<DrawerLayoutAndroid
|
<DrawerLayoutAndroid
|
||||||
drawerWidth={300}
|
drawerWidth={300}
|
||||||
drawerPosition={DrawerLayoutAndroid.positions.Left}
|
drawerPosition={DrawerLayoutAndroid.positions.Left}
|
||||||
renderNavigationView={() => <Menu />}>
|
renderNavigationView={() => <Menu refreshConnection={this.refreshConnection}
|
||||||
|
refreshAvatar={this.refreshAvatar}
|
||||||
|
disconnect={this.disconnect} />}>
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<View style={styles.navbar}>
|
<View style={styles.navbar}>
|
||||||
<Navbar avatar={avatarLink} />
|
<Navbar avatar={avatarLink} />
|
||||||
@@ -100,6 +102,6 @@ const styles = {
|
|||||||
flex: 15
|
flex: 15
|
||||||
},
|
},
|
||||||
adspace: {
|
adspace: {
|
||||||
flex: 2
|
flex: 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,13 +22,14 @@ const backgroundLink = '../../assets/images/homeBg.jpg';
|
|||||||
type Props = {};
|
type Props = {};
|
||||||
export default class Menu extends Component<Props> {
|
export default class Menu extends Component<Props> {
|
||||||
render() {
|
render() {
|
||||||
|
const { refreshConnection, refreshAvatar, disconnect } = this.props;
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<ImageBackground style={styles.header} source={require(backgroundLink)} >
|
<ImageBackground style={styles.header} source={require(backgroundLink)} >
|
||||||
<Text style={styles.hdrTxt}>Menu</Text>
|
<Text style={styles.hdrTxt}>Menu</Text>
|
||||||
</ImageBackground>
|
</ImageBackground>
|
||||||
<View style={styles.main}>
|
<View style={styles.main}>
|
||||||
<TouchableOpacity>
|
<TouchableOpacity onPress={refreshConnection}>
|
||||||
<View style={styles.option}>
|
<View style={styles.option}>
|
||||||
<Text style={styles.optTxt}>Refresh Connection</Text>
|
<Text style={styles.optTxt}>Refresh Connection</Text>
|
||||||
<Icon
|
<Icon
|
||||||
@@ -37,7 +38,7 @@ export default class Menu extends Component<Props> {
|
|||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
<TouchableOpacity>
|
<TouchableOpacity onPress={refreshAvatar}>
|
||||||
<View style={styles.option}>
|
<View style={styles.option}>
|
||||||
<Text style={styles.optTxt}>Change Avatar</Text>
|
<Text style={styles.optTxt}>Change Avatar</Text>
|
||||||
<Icon
|
<Icon
|
||||||
@@ -46,7 +47,7 @@ export default class Menu extends Component<Props> {
|
|||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
<TouchableOpacity>
|
<TouchableOpacity onPress={disconnect}>
|
||||||
<View style={styles.option}>
|
<View style={styles.option}>
|
||||||
<Text style={styles.optTxt}>Disconnect</Text>
|
<Text style={styles.optTxt}>Disconnect</Text>
|
||||||
<Icon
|
<Icon
|
||||||
|
|||||||
+3
-1
@@ -1,6 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "Nexto",
|
"name": "Nexto",
|
||||||
"version": "0.0.1",
|
"version": "1.0.1",
|
||||||
|
"description": "Spontaneous connection with peers whether in a library, classroom, or coffee shop.",
|
||||||
|
"author": "Arjun Patel",
|
||||||
"private": true,
|
"private": true,
|
||||||
"rnpm": {
|
"rnpm": {
|
||||||
"assets": [
|
"assets": [
|
||||||
|
|||||||
@@ -1,73 +0,0 @@
|
|||||||
var app = require('express')();
|
|
||||||
var server = require('http').Server(app);
|
|
||||||
var io = require('socket.io')(server);
|
|
||||||
var mysql = require('mysql');
|
|
||||||
|
|
||||||
var con = mysql.createConnection({
|
|
||||||
host: 'us-cdbr-iron-east-04.cleardb.net',
|
|
||||||
user: 'bc7fa7fdf1822b',
|
|
||||||
password: 'f62b55b3',
|
|
||||||
database: 'heroku_99e764eb3c2ab7e'
|
|
||||||
});
|
|
||||||
|
|
||||||
var port = 3000;
|
|
||||||
server.listen(port, () => console.log('serving on port: ' + port));
|
|
||||||
|
|
||||||
app.get('/', function (req, res) {
|
|
||||||
res.sendFile(__dirname + '/index.html');
|
|
||||||
});
|
|
||||||
|
|
||||||
io.on('connection', function (socket) {
|
|
||||||
console.log('Client connected: ' + socket.id);
|
|
||||||
|
|
||||||
socket.on('initial', (position) => {
|
|
||||||
console.log(position.long + ' ' + position.lat);
|
|
||||||
//var sql = 'select * from messages where lng = 0';
|
|
||||||
var sql = 'SELECT * FROM messages HAVING (6371393 * acos(cos(radians((?))) * cos(radians(lat)) * cos(radians(lng) - radians((?))) + sin(radians((?))) * sin(radians(lat))) < 100) ORDER BY id;'
|
|
||||||
con.query(sql, [position.lat, position.long, position.lat], function (err, result, fields) {
|
|
||||||
if (err) throw err;
|
|
||||||
socket.emit('initMessages', result);
|
|
||||||
console.log('sent all initial messages');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
//io.on('test', () => console.log('worked~')); // test with web page
|
|
||||||
|
|
||||||
socket.on('newMessage', function(msg) {
|
|
||||||
var sql = "INSERT INTO messages (userId, text, createdAt, lng, lat) VALUES (?, ?, ?, ?, ?)";
|
|
||||||
var currTime = new Date().toString();
|
|
||||||
con.query(sql, [msg.userId, msg.text, currTime, msg.lng, msg.lat], function(err, result) {
|
|
||||||
if (err) throw err;
|
|
||||||
console.log('Message sent to db!');
|
|
||||||
|
|
||||||
var msgId = 0;
|
|
||||||
con.query('SELECT LAST_INSERT_ID()', function(err, result) {
|
|
||||||
if(err) throw err;
|
|
||||||
msgId = result;
|
|
||||||
console.log(msgId);
|
|
||||||
});
|
|
||||||
var uploadedMsg = {
|
|
||||||
id: msgId,
|
|
||||||
userId: msg.userId,
|
|
||||||
text: msg.text,
|
|
||||||
createdAt: currTime,
|
|
||||||
lng: msg.lng,
|
|
||||||
lat: msg.lat
|
|
||||||
};
|
|
||||||
io.emit('newMessage', uploadedMsg);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
socket.on('disconnect', function() {
|
|
||||||
console.log('Client disconnected: ' + socket.id);
|
|
||||||
});
|
|
||||||
|
|
||||||
connection.on('error', function (err) {
|
|
||||||
if (!err.fatal) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (err.code !== 'PROTOCOL_CONNECTION_LOST') {
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<h1>Welcome</h1>
|
|
||||||
|
|
||||||
<script src="/socket.io/socket.io.js"></script>
|
|
||||||
<script>
|
|
||||||
var socket = io();
|
|
||||||
socket.emit('test');
|
|
||||||
</script>
|
|
||||||
Reference in New Issue
Block a user