Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
v 1.1 !!!!!!!1
Browse files Browse the repository at this point in the history
bugfixes & rework acct setup methods
  • Loading branch information
connlark committed Nov 16, 2017
1 parent e113e8a commit a6ce507
Show file tree
Hide file tree
Showing 19 changed files with 482 additions and 80 deletions.
Binary file added jbumapp/B33TyJ8dQWnESdR.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class PasswordPage extends Component {
}}
icon={{name: 'account-circle'}}
textStyle={{fontSize: 22, color: 'white'}}
title='Choose Password' />
title='Continue' />
</View>
}
</View>
Expand Down
2 changes: 1 addition & 1 deletion jbumapp/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const MyApp = createContainer(() => {

const codePushOptions = {
checkFrequency: codePush.CheckFrequency.ON_APP_RESUME,
installMode: codePush.InstallMode.ON_NEXT_RESUME,
installMode: codePush.InstallMode.ON_APP_RESUME,
};

export default codePush(codePushOptions)(MyApp);
20 changes: 10 additions & 10 deletions jbumapp/app/screens/Settings/Settings.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ class Settings extends Component {

signOut = () => {
Meteor.call('notifications.remove.pushToken', err => {
if (err) { alert(`notifications.rm.pushToken: ${err.reason}`); }
});
Meteor.logout(() => {
const resetAction = NavigationActions.reset({
index: 0,
key: null,
actions: [
NavigationActions.navigate({ routeName: 'HomeStack' }),
],
if (err) { console.log(`notifications.rm.pushToken: ${err.reason}`); }
Meteor.logout(() => {
const resetAction = NavigationActions.reset({
index: 0,
key: null,
actions: [
NavigationActions.navigate({ routeName: 'HomeStack' }),
],
});
this.props.navigation.navigate('Welcome');
});
this.props.navigation.navigate('Welcome');
});
};

Expand Down
10 changes: 5 additions & 5 deletions jbumapp/app/screens/Settings/Settings.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ class Settings extends Component {
[
{text: 'Ok', onPress: () => {
Meteor.call('notifications.remove.pushToken', err => {
if (err) { alert(`notifications.rm.pushToken: ${err.reason}`); }
});
Meteor.logout(() => {
AsyncStorage.setItem(ACNTSETUP_KEY, 'false')
this.props.navigation.navigate('WelcomeStack');
if (err) { console.log(`notifications.rm.pushToken: ${err.reason}`); }
Meteor.logout(() => {
AsyncStorage.setItem(ACNTSETUP_KEY, 'false')
this.props.navigation.navigate('WelcomeStack');
});
});
}},
{text: 'Cancel', onPress: () => (null)},
Expand Down
111 changes: 70 additions & 41 deletions jbumapp/app/screens/Welcome/Welcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import {
NetInfo,
ActivityIndicator
} from 'react-native';
import Meteor, { Accounts } from 'react-native-meteor';
import Meteor, { Accounts, createContainer } from 'react-native-meteor';
import { Button } from 'react-native-elements';
import * as Animatable from 'react-native-animatable';
import FadeInView from 'react-native-fade-in-view';
import ReactNativeHaptic from 'react-native-haptic';
import _ from 'lodash';

import Wallpaper from '../../components/Wallpaper';
import {email} from '../../components/Communications';
Expand All @@ -24,13 +25,14 @@ import { changeNetworkStatus } from '../../actions/network';
const B = (props) => <Text style={styles.textBold}>{props.children}</Text>
const URL_KEY = 'thisisfun';

export default class Welcome extends Component {
class Welcome extends Component {
constructor(props) {
super(props);
this.state = {
hasOpenedURL:false,
loggingIn: false,
loginData:null
loginData:null,
isCreatingAccount:false
}
this.mounted = false;
}
Expand Down Expand Up @@ -61,9 +63,11 @@ export default class Welcome extends Component {
}

handleNetworkChange = (info) => {
const { user } = this.props;
this.props.navigation.dispatch(changeNetworkStatus(info))
if (info !== 'none' && Meteor.userId()) {
this.props.navigation.navigate('Home')

if (info !== 'none' && user) {
this.props.navigation.navigate('HomeStack')
}
}

Expand All @@ -76,56 +80,75 @@ export default class Welcome extends Component {
});
ReactNativeHaptic.generate('selection')
if (this.state.hasOpenedURL) return;
const { navigation } = this.props;

const url = event.url;
const linkData = url.replace(/.*?:\/\//g, '');
this.setState({hasOpenedURL:true});
this.handleCreateAccount(linkData);
var handleCreateAccountOnce = _.once(this.handleCreateAccount.bind(this));

setTimeout(() => {
handleCreateAccountOnce(linkData);
}, 500);
}

handleCreateAccount = (linkData) => {
if (linkData !== null && !Meteor.userId()) {
Meteor.call('createUserAccount', linkData, (err, response) => {
if (err) {
console.log("err: "+err.reason);
Alert.alert(
'Oops! Invite link didn\'t work','',
[
{text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
{text: 'Help', onPress: () => email('contact@bitbybite.co','connor.larkin1@gmail.com','','I Need Help creating my JBUM account','🌀 your problem here 🌀')},
],
{ cancelable: false }
);
return;
} else {
this.state.loginData = response;
this.handleLogin();
}
});
}
if (this.state.isCreatingAccount) return;

const { user } = this.props;
if (linkData !== null ) this.handleLogin();
if (user) this.props.navigation.navigate('HomeStack')
this.setState({isCreatingAccount:true})

Meteor.call('createUserAccount', linkData, (err, response) => {
if (err) {
console.log("err: "+err.reason);
Alert.alert(
'Oops! Invite link didn\'t work','',
[
{text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
{text: 'Help', onPress: () => Linking.openURL('mailto:contact@bitbybite.co?subject=🚧 Reporting a problem with JBUM 🚧&body=🌀 your problem here 🌀')},
],
{ cancelable: false }
);
this.setState({hasOpenedURL:false});
return;
} else if (response && typeof(response) != 'undefined'){
this.handleLogin(response);
}
else {
this.setState({hasOpenedURL:false});
}
});
}
handleLogin = () => {
if(this.state.loginData !== null && !Meteor.userId()){
const { loginData } = this.state;
console.log(loginData);
Meteor.loginWithPassword(loginData.username, loginData.password, (err) => {
if (err) {
Alert.alert(
'Oops! Screenshot this and send to support!',
'Server error: \n\n'+err.details
);
}
this.props.navigation.navigate('AccountSetup', { loginData: loginData })
});

handleLogin = (response) => {
if (!response) {
this.setState({hasOpenedURL:false});
return;
}

Meteor.loginWithPassword(response.username, response.password, (err) => {
if (err) {
Alert.alert(
'Oops! Screenshot this and send to support!',
'Server error: \n\n'+err.details
);
this.setState({hasOpenedURL:false});
}
else {
this.props.navigation.navigate('AccountSetup', { loginData: response });
this.setState({hasOpenedURL:false});
}
});

}

toCreateAccount = () => {
Alert.alert(
'Please navigate to your email application and tap the invite link we sent you','',
'Please navigate our site to create an account!','Currently we are in a closed beta. If you wish to be included email contact@bitbybite.co.',
[
{text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
{text: 'Help', onPress: () => Linking.openURL('mailto:contact@bitbybite.co?subject=🚧 Reporting a problem with JBUM 🚧&body=🌀 your problem here 🌀')},
{text: 'Go There', onPress: () => Linking.openURL('https://jbum.meteorapp.com/beta')},
],
{ cancelable: false }
);
Expand Down Expand Up @@ -197,6 +220,12 @@ export default class Welcome extends Component {
}
}

export default WelcomeContainer = createContainer((props) => {
return {
user: Meteor.user()
}
}, Welcome);

const styles = StyleSheet.create({
container: {
flex: 1,
Expand Down
24 changes: 21 additions & 3 deletions jbumapp/ios/Preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -215,22 +215,22 @@
<div class="app-description">
<div class="cat-headline">Description</div>
<div class="app-description-text">
Have you ever wanted to get advice about something going in your life, but from a different perspective than your friends, teachers or parents?<br /><br />Do you ever feel isolated, stressed, anxious or depressed and need to get help getting through it?<br /><br />Do you want to help others going through the same things you’ve gone through but without making the mistakes that you did?<br /><br />JBUM is a safe, anonymous, invite-only, online community where you can ask questions in real life.<br /><br />You are not alone and your life matters! This app was created by kids for kids to help you give support or get support for the real issues in life.<br />The app will allow you to:<br /><br />Connect anytime and anywhere with others that genuinely care about you<br />Ask questions about ANY problem that you are facing in your life<br />Help others that are going through tough times<br /><br />You also get to choose who you want to get input from:<br /><br />Peers<br />Adults<br />Professionals<br /><br />…ANONYMOUSLY<br /><br /><br />***WE TAKE YOUR SAFETY SERIOUSLY***<br /><br />No personal identifying information is ever taken<br />Every question and response flagged for inappropriateness by the community is taken off immediately<br />One-way communication ensures that questions and responses are well thought out before being posted<br />EMERGENCY BUTTON - if you are in danger or need immediate help click on the Red emergency button and you will be c​onnected with our 24-hour hotline.<br /><br /><br />****This is the BETA version! If you find any bugs or have ANY suggestions, please let us know!****<br />Contact our administrator: contact@bitbybite.co<br />
Have you ever wanted to get advice about something going in your life, but from a different perspective than your friends, teachers or parents?<br /><br />Do you ever feel isolated, stressed, anxious or depressed and need to get help getting through it?<br /><br />Do you want to help others going through the same things you’ve gone through but without making the mistakes that you did?<br /><br />JBUM is a safe, anonymous, invite-only, online community where you can ask questions in real life.<br /><br />You are not alone and your life matters! This app was created by kids for kids to help you give support or get support for the real issues in life.<br /><br />The app will allow you to:<br /><br />• Connect anytime and anywhere with others that genuinely care about you<br /><br />• Ask questions about ANY problem that you are facing in your life<br /><br />• Help others that are going through tough times<br /><br />You also get to choose who you want to get input from:<br /><br />Peers<br />Adults<br />Professionals<br /><br />…ANONYMOUSLY<br /><br /><br />***WE TAKE YOUR SAFETY SERIOUSLY***<br /><br />• No personal identifying information is ever taken<br />• Every question and response flagged for inappropriateness by the community is taken off immediately<br />• One-way communication ensures that questions and responses are well thought out before being posted<br />• EMERGENCY BUTTON - if you are in danger or need immediate help click on the Red emergency button and you will be c​onnected with our 24-hour hotline.<br /><br /><br />****If you find any bugs or have ANY suggestions, please let us know!****<br /><br />Contact our administrator: contact@bitbybite.co
</div>
</div>



<div class="app-changelog">
<div class="cat-headline">Changelog</div>
<br />
• Fixes some bugs preventing account setup <br />• Adds some minor UI improvements <br /><br />Thanks for using JBUM!<br />
</div>



<div class="app-changelog">
<div class="cat-headline">Promotional Text</div>
A completely anonymous app for users to ask their deepest questions about life without judgment and to help each other out in the midst of their greatest difficulties.<br />
A completely anonymous app for users to ask their deepest questions about life without judgment and to help each other out in the midst of their greatest difficulties.
</div>


Expand Down Expand Up @@ -298,6 +298,24 @@ <h4>iPhone 6 Plus</h4>



<h4>iPhone X</h4>
<div class="app-screenshot-row">


<a href="./fastlane/screenshots/en-US/iPhone%20X-AnswerScreen.png" target="_blank"><img class="app-screenshot" src="./fastlane/screenshots/en-US/iPhone%20X-AnswerScreen.png" title="Screenshot #0 for en-US"></a>

<a href="./fastlane/screenshots/en-US/iPhone%20X-AskScreen.png" target="_blank"><img class="app-screenshot" src="./fastlane/screenshots/en-US/iPhone%20X-AskScreen.png" title="Screenshot #1 for en-US"></a>

<a href="./fastlane/screenshots/en-US/iPhone%20X-HomeScreen.png" target="_blank"><img class="app-screenshot" src="./fastlane/screenshots/en-US/iPhone%20X-HomeScreen.png" title="Screenshot #2 for en-US"></a>

<a href="./fastlane/screenshots/en-US/iPhone%20X-InboxScreen.png" target="_blank"><img class="app-screenshot" src="./fastlane/screenshots/en-US/iPhone%20X-InboxScreen.png" title="Screenshot #3 for en-US"></a>

<a href="./fastlane/screenshots/en-US/iPhone%20X-ProfileScreen.png" target="_blank"><img class="app-screenshot" src="./fastlane/screenshots/en-US/iPhone%20X-ProfileScreen.png" title="Screenshot #4 for en-US"></a>

</div>



<h4>iPad</h4>
<div class="app-screenshot-row">

Expand Down
22 changes: 13 additions & 9 deletions jbumapp/ios/fastlane/metadata/en-US/description.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ Do you want to help others going through the same things you’ve gone through b
JBUM is a safe, anonymous, invite-only, online community where you can ask questions in real life.

You are not alone and your life matters! This app was created by kids for kids to help you give support or get support for the real issues in life.

The app will allow you to:

Connect anytime and anywhere with others that genuinely care about you
Ask questions about ANY problem that you are facing in your life
Help others that are going through tough times
• Connect anytime and anywhere with others that genuinely care about you

• Ask questions about ANY problem that you are facing in your life

• Help others that are going through tough times

You also get to choose who you want to get input from:

Expand All @@ -24,11 +27,12 @@ Professionals

***WE TAKE YOUR SAFETY SERIOUSLY***

No personal identifying information is ever taken
Every question and response flagged for inappropriateness by the community is taken off immediately
One-way communication ensures that questions and responses are well thought out before being posted
EMERGENCY BUTTON - if you are in danger or need immediate help click on the Red emergency button and you will be c​onnected with our 24-hour hotline.
• No personal identifying information is ever taken
• Every question and response flagged for inappropriateness by the community is taken off immediately
• One-way communication ensures that questions and responses are well thought out before being posted
• EMERGENCY BUTTON - if you are in danger or need immediate help click on the Red emergency button and you will be c​onnected with our 24-hour hotline.


****If you find any bugs or have ANY suggestions, please let us know!****

****This is the BETA version! If you find any bugs or have ANY suggestions, please let us know!****
Contact our administrator: contact@bitbybite.co
Contact our administrator: contact@bitbybite.co
2 changes: 1 addition & 1 deletion jbumapp/ios/fastlane/metadata/en-US/promotional_text.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
A completely anonymous app for users to ask their deepest questions about life without judgment and to help each other out in the midst of their greatest difficulties.
A completely anonymous app for users to ask their deepest questions about life without judgment and to help each other out in the midst of their greatest difficulties.
3 changes: 3 additions & 0 deletions jbumapp/ios/fastlane/metadata/en-US/release_notes.txt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
• Fixes some bugs preventing account setup
• Adds some minor UI improvements

Thanks for using JBUM!
2 changes: 1 addition & 1 deletion jbumapp/ios/jbumapp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>32</string>
<string>36</string>
<key>CodePushDeploymentKey</key>
<string>$(CODEPUSH_KEY)</string>
<key>ITSAppUsesNonExemptEncryption</key>
Expand Down
2 changes: 1 addition & 1 deletion jbumapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"eslint-plugin-react": "^7.3.0",
"jest": "19.0.2",
"react-native-keyboard-spacer": "0.3.0",
"react-native-meteor": "^1.1.0",
"react-native-meteor": "1.2.0",
"react-native-tab-navigator": "0.3.3",
"react-test-renderer": "16.0.0-alpha.6"
},
Expand Down
2 changes: 1 addition & 1 deletion jbumapp/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4470,7 +4470,7 @@ react-native-material-ui@^1.6.0:
prop-types "^15.5.10"
react-native-material-design-styles "^0.2.6"

react-native-meteor@^1.1.0:
react-native-meteor@1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/react-native-meteor/-/react-native-meteor-1.2.0.tgz#95fd1d9f33e4e20d7b2d0dee2cf3b5529557d6b9"
dependencies:
Expand Down
4 changes: 1 addition & 3 deletions jbummeteor/imports/api/userData/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,10 @@ Meteor.methods({
});
},
'notifications.remove.pushToken'() {

const userId = this.userId;
if (!userId) {
throw new Meteor.Error(SET_PUSH_TOKEN, 'Must be logged in remove push notification token.');
return;
}

Meteor.users.update(userId, {
$set: { pushToDevices: [] },
});
Expand Down
2 changes: 2 additions & 0 deletions jbummeteor/imports/startup/client/routes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import MainContainer from '../../ui/containers/MainContainer.jsx'

// pages
import LoginPage from '../../ui/pages/Login.jsx'
import BetaPage from '../../ui/pages/Beta.jsx'

export const renderRoutes = () => (
<Router>
<div>
<Route path="/" component={AppContainer}/>
<Route exact path="/login" component={LoginPage}/>
<Route exact path="/beta" component={BetaPage}/>
</div>
</Router>
);
5 changes: 4 additions & 1 deletion jbummeteor/imports/ui/containers/AppContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export default class AppContainer extends Component {
}

componentWillMount(){
if (!this.state.isAuthenticated) {
if (this.props.history.location.pathname === '/beta'){
this.props.history.push('/beta');
}
else if (!this.state.isAuthenticated) {
this.props.history.push('/login');
}
}
Expand Down
Loading

0 comments on commit a6ce507

Please sign in to comment.