From f447ed39a8351cadd2cfcd521a270fb73d393f34 Mon Sep 17 00:00:00 2001 From: David Biga Date: Thu, 12 Mar 2020 22:02:38 -0500 Subject: [PATCH 001/304] Update README (#27) --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 959731522d..f47d93c1f3 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,13 @@ Android is currently being optimized. iOS will need to be tested, optimized, an Refer to and run the dev_setup.sh for needed tools. +### iOS Configuration - First Time Setup + +1. pod install in `ios` directory +2. Open `.workspace` file in the iOS directory and run `build` +3. If you have any trouble with packages not round, try `react-native link` from project directory. +4. Look at running commands below. + ## Running Install modules: @@ -30,7 +37,7 @@ npx react-native run-android ``` or ``` -npx react-native run-ios +npx react-native run-ios --simulator="iPhone 8 Plus" ``` ## Deploying From f6ceeffa9326f9ed7896f88b35e920df902897b4 Mon Sep 17 00:00:00 2001 From: David Biga Date: Thu, 12 Mar 2020 22:33:18 -0500 Subject: [PATCH 002/304] Share action (#28) --- app/views/Export.js | 110 +++++++++++--------------------------------- 1 file changed, 27 insertions(+), 83 deletions(-) diff --git a/app/views/Export.js b/app/views/Export.js index 7e5a219ddf..9d7440c692 100644 --- a/app/views/Export.js +++ b/app/views/Export.js @@ -7,7 +7,8 @@ import { View, Text, Alert, - Image + Image, + Share } from 'react-native'; import colors from "../constants/colors"; @@ -15,94 +16,43 @@ import { WebView } from 'react-native-webview'; import Button from "../components/Button"; import NegButton from "../components/NegButton"; import BackgroundGeolocation from '@mauron85/react-native-background-geolocation'; +import {GetStoreData} from '../helpers/General'; class ExportScreen extends Component { constructor(props) { super(props); } componentDidMount() { + } - /*BackgroundGeolocation.on('location', (location) => { + onShare = async () => { + try { + const locationArray = await GetStoreData('LOCATION_DATA'); + var locationData; + if (locationArray !== null) { + locationData = JSON.parse(locationArray); + } else { + locationData = []; + } - GetStoreData('LOCATION_DATA') - .then(locationArray => { - var locationData; + const result = await Share.share({ + message: JSON.stringify(locationData) + }); - if (locationArray !== null) { - locationData = JSON.parse(locationArray); + if (result.action === Share.sharedAction) { + if (result.activityType) { + // shared with activity type of result.activityType } else { - locationData = []; + // shared } - - locationData.push(location); - SetStoreData('LOCATION_DATA', locationData); - }); - - // to perform long running operation on iOS - // you need to create background task - BackgroundGeolocation.startTask(taskKey => { - // execute long running task - // eg. ajax post location - // IMPORTANT: task has to be ended by endTask - BackgroundGeolocation.endTask(taskKey); - }); - }); - - BackgroundGeolocation.on('stationary', (stationaryLocation) => { - // handle stationary locations here - // Actions.sendLocation(stationaryLocation); - console.log('[INFO] stationaryLocation:', stationaryLocation); - }); - - BackgroundGeolocation.on('error', (error) => { - console.log('[ERROR] BackgroundGeolocation error:', error); - }); - - BackgroundGeolocation.on('start', () => { - console.log('[INFO] BackgroundGeolocation service has been started'); - }); - - BackgroundGeolocation.on('stop', () => { - console.log('[INFO] BackgroundGeolocation service has been stopped'); - }); - - BackgroundGeolocation.on('authorization', (status) => { - console.log('[INFO] BackgroundGeolocation authorization status: ' + status); - if (status !== BackgroundGeolocation.AUTHORIZED) { - // we need to set delay or otherwise alert may not be shown - setTimeout(() => - Alert.alert('App requires location tracking permission', 'Would you like to open app settings?', [ - { text: 'Yes', onPress: () => BackgroundGeolocation.showAppSettings() }, - { text: 'No', onPress: () => console.log('No Pressed'), style: 'cancel' } - ]), 1000); + } else if (result.action === Share.dismissedAction) { + // dismissed + } + } catch (error) { + console.log(error.message); } - }); - - BackgroundGeolocation.on('background', () => { - console.log('[INFO] App is in background'); - }); - - BackgroundGeolocation.on('foreground', () => { - console.log('[INFO] App is in foreground'); - }); - - BackgroundGeolocation.on('abort_requested', () => { - console.log('[INFO] Server responded with 285 Updates Not Required'); - - // Here we can decide whether we want stop the updates or not. - // If you've configured the server to return 285, then it means the server does not require further update. - // So the normal thing to do here would be to `BackgroundGeolocation.stop()`. - // But you might be counting on it to receive location updates in the UI, so you could just reconfigure and set `url` to null. - }); - - BackgroundGeolocation.on('http_authorization', () => { - console.log('[INFO] App needs to authorize the http requests'); - }); - - // you can also just start without checking for status - // BackgroundGeolocation.start();*/ - } + }; componentWillUnmount() { // unregister all event listeners @@ -116,14 +66,8 @@ class ExportScreen extends Component { Export Data - - Rolling out soon - - +