From 1ab6d52245be70e5db18405b0d6a0825148ec596 Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Sun, 29 Jul 2018 10:57:28 -0700 Subject: [PATCH] adding in functionality for menu, disabling ad space for now, and deplying config --- .expo/settings.json | 7 ++++ android/app/build.gradle | 11 ++++++ android/gradle.properties | 5 +++ app.json | 7 ++-- app/screens/main.js | 6 ++-- app/screens/main/menu.js | 7 ++-- package.json | 4 ++- server/app.js | 73 --------------------------------------- server/index.html | 7 ---- 9 files changed, 39 insertions(+), 88 deletions(-) create mode 100644 .expo/settings.json delete mode 100644 server/app.js delete mode 100644 server/index.html diff --git a/.expo/settings.json b/.expo/settings.json new file mode 100644 index 0000000..4867041 --- /dev/null +++ b/.expo/settings.json @@ -0,0 +1,7 @@ +{ + "hostType": "tunnel", + "lanType": "ip", + "dev": true, + "minify": false, + "urlRandomness": null +} \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index 1117778..e186659 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -116,10 +116,21 @@ android { 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 { release { minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" + signingConfig signingConfigs.release } } // applicationVariants are e.g. debug, release diff --git a/android/gradle.properties b/android/gradle.properties index 1fd964e..c060960 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -18,3 +18,8 @@ # org.gradle.parallel=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 diff --git a/app.json b/app.json index e715ec3..7e60bd1 100644 --- a/app.json +++ b/app.json @@ -1,4 +1,7 @@ { "name": "Nexto", - "displayName": "Nexto" -} \ No newline at end of file + "displayName": "Nexto", + "android": { + "package": "com.nexto.nexto" + } +} diff --git a/app/screens/main.js b/app/screens/main.js index 5fe6816..98c8bbd 100644 --- a/app/screens/main.js +++ b/app/screens/main.js @@ -69,7 +69,9 @@ export default class Main extends Component { }> + renderNavigationView={() => }> @@ -100,6 +102,6 @@ const styles = { flex: 15 }, adspace: { - flex: 2 + flex: 0 } } diff --git a/app/screens/main/menu.js b/app/screens/main/menu.js index c768246..3ac332d 100644 --- a/app/screens/main/menu.js +++ b/app/screens/main/menu.js @@ -22,13 +22,14 @@ const backgroundLink = '../../assets/images/homeBg.jpg'; type Props = {}; export default class Menu extends Component { render() { + const { refreshConnection, refreshAvatar, disconnect } = this.props; return ( Menu - + Refresh Connection { /> - + Change Avatar { /> - + Disconnect 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; - } - }); -}); diff --git a/server/index.html b/server/index.html deleted file mode 100644 index fa052bc..0000000 --- a/server/index.html +++ /dev/null @@ -1,7 +0,0 @@ -

Welcome

- - -