Skip to content

Commit

Permalink
Upgrade to React Native 0.59.2 as it has 64-bit support for Android
Browse files Browse the repository at this point in the history
  • Loading branch information
chico committed Aug 22, 2019
1 parent ccb9b2c commit 99961aa
Show file tree
Hide file tree
Showing 26 changed files with 6,021 additions and 6,757 deletions.
8 changes: 0 additions & 8 deletions .babelrc

This file was deleted.

10 changes: 5 additions & 5 deletions .env.beta
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ SOCKET_IO_URL=https://codeandrobots-simulator.herokuapp.com
FIREBASE_TOPIC=
SEGMENT_WRITE_KEY=
IOS_APP_ID=
APP_DOWNLOAD_URL=http://codeandrobots.com
FAQ_URL=http://codeandrobots.com/faq.html
ABOUT_URL=http://codeandrobots.com/about.html
PRIVACY_URL=http://codeandrobots.com/privacy.html
SUPPORT_EMAIL=codeandrobotshq@gmail.com
APP_DOWNLOAD_URL=http://ottodiy.com
FAQ_URL=https://wikifactory.com/+OttoDIY/forum
ABOUT_URL=http://ottodiy.com
PRIVACY_URL=https://www.ottodiy.com/?open=privacy-policy
SUPPORT_EMAIL=support@ottodiy.com
10 changes: 5 additions & 5 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ SOCKET_IO_URL=https://codeandrobots-simulator.herokuapp.com
FIREBASE_TOPIC=
SEGMENT_WRITE_KEY=
IOS_APP_ID=
APP_DOWNLOAD_URL=http://codeandrobots.com
FAQ_URL=http://codeandrobots.com/faq.html
ABOUT_URL=http://codeandrobots.com/about.html
PRIVACY_URL=http://codeandrobots.com/privacy.html
SUPPORT_EMAIL=codeandrobotshq@gmail.com
APP_DOWNLOAD_URL=http://ottodiy.com
FAQ_URL=https://wikifactory.com/+OttoDIY/forum
ABOUT_URL=http://ottodiy.com
PRIVACY_URL=https://www.ottodiy.com/?open=privacy-policy
SUPPORT_EMAIL=support@ottodiy.com
33 changes: 27 additions & 6 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
; Ignore polyfills
.*/Libraries/polyfills/.*

; Ignore metro
.*/node_modules/metro/.*

[include]

[libs]
Expand All @@ -25,24 +28,42 @@ node_modules/react-native/flow/
[options]
emoji=true

esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable

module.system=haste
module.system.haste.use_name_reducers=true
# get basename
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
# strip .js or .js.flow suffix
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
# strip .ios suffix
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
module.system.haste.paths.blacklist=.*/__tests__/.*
module.system.haste.paths.blacklist=.*/__mocks__/.*
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*

munge_underscores=true

module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'

module.file_ext=.js
module.file_ext=.jsx
module.file_ext=.json
module.file_ext=.native.js

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_type=$FixMe

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-7]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-7]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

unsafe.enable_getters_and_setters=true

[version]
^0.57.0
^0.92.0
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ api-*.json
ios/Otto/GoogleService-Info-Beta.plist
ios/Otto/GoogleService-Info.plist

# Bundle artifact
*.jsbundle

# Misc
#
.env
Expand Down
2 changes: 1 addition & 1 deletion App/Config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import DebugConfig from './DebugConfig'
import AppConfig from './AppConfig'

// Allow/disallow font-scaling in app
Text.defaultProps.allowFontScaling = AppConfig.allowTextFontScaling
// Text.defaultProps.allowFontScaling = AppConfig.allowTextFontScaling

if (__DEV__) {
// If ReactNative's yellow box warnings are too much, it is possible to turn
Expand Down
80 changes: 42 additions & 38 deletions App/Containers/RootContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { connect } from 'react-redux'
import StartupActions from '../Redux/StartupRedux'
import ReduxPersist from '../Config/ReduxPersist'

import firebase from 'react-native-firebase'
// TODO Fix firebase code
// import firebase from 'react-native-firebase'
import DeviceInfo from 'react-native-device-info'

import Bluetooth from 'App/Services/Bluetooth'
Expand All @@ -17,29 +18,30 @@ class RootContainer extends Component {
componentDidMount () {
this.appOpenedFromPushNotification = false

if (!this.isSimulator()) {
firebase.notifications().getInitialNotification()
.then((notificationOpen) => {
if (notificationOpen) {
// App was opened by a notification
// See https://github.com/invertase/react-native-firebase-docs/blob/master/docs/notifications/receiving-notifications.md
this.appOpenedFromPushNotification = true
}
})

this.notificationOpenedListener = firebase.notifications().onNotificationOpened((notificationOpen) => {
// App is in the foreground or background, notification was clicked / tapped / opened
// See https://github.com/invertase/react-native-firebase-docs/blob/master/docs/notifications/receiving-notifications.md
if (AppState.currentState === 'background') {
this.appOpenedFromPushNotification = true
}

const user = (this.props.credentials)
? this.props.credentials.user
: undefined
trackEvent({user, event: Events.NOTIFICATION_OPENED})
})
}
// TODO Fix firebase code
// if (!this.isSimulator()) {
// firebase.notifications().getInitialNotification()
// .then((notificationOpen) => {
// if (notificationOpen) {
// // App was opened by a notification
// // See https://github.com/invertase/react-native-firebase-docs/blob/master/docs/notifications/receiving-notifications.md
// this.appOpenedFromPushNotification = true
// }
// })
//
// this.notificationOpenedListener = firebase.notifications().onNotificationOpened((notificationOpen) => {
// // App is in the foreground or background, notification was clicked / tapped / opened
// // See https://github.com/invertase/react-native-firebase-docs/blob/master/docs/notifications/receiving-notifications.md
// if (AppState.currentState === 'background') {
// this.appOpenedFromPushNotification = true
// }
//
// const user = (this.props.credentials)
// ? this.props.credentials.user
// : undefined
// trackEvent({user, event: Events.NOTIFICATION_OPENED})
// })
// }

this.sessionStartTime = new Date()

Expand All @@ -53,9 +55,10 @@ class RootContainer extends Component {

componentWillUnmount () {
Bluetooth.stopService()
if (!this.isSimulator()) {
this.notificationOpenedListener()
}
// TODO Fix firebase code
// if (!this.isSimulator()) {
// this.notificationOpenedListener()
// }
AppState.removeEventListener('change', this.appStateChange)
}

Expand Down Expand Up @@ -92,19 +95,20 @@ class RootContainer extends Component {
}
this.appOpenedFromPushNotification = false

// TODO Fix firebase code
// Need to check for push notification permission every time
// just in case user has just accepted it or changed it in settings
if (!this.isSimulator()) {
firebase.messaging().hasPermission()
.then(enabled => {
if (enabled) {
properties.pushNotificationsEnabled = true
}
trackEvent({user, event: event, properties})
})
} else {
trackEvent({user, event: event, properties})
}
// if (!this.isSimulator()) {
// firebase.messaging().hasPermission()
// .then(enabled => {
// if (enabled) {
// properties.pushNotificationsEnabled = true
// }
// trackEvent({user, event: event, properties})
// })
// } else {
trackEvent({user, event: event, properties})
// }
}

render () {
Expand Down
Loading

0 comments on commit 99961aa

Please sign in to comment.