This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import BackgroundTimer from 'react-native-background-timer' | |
| const intervalId = BackgroundTimer.setInterval(() => { | |
| let now = new Date() | |
| let data = JSON.stringify({'lat': 20, 'long': 20, 'time': now }) | |
| fetch('http://192.168.107.24:8080', { | |
| method: 'POST', | |
| headers: { | |
| 'Accept': 'application/json', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *) | |
| launchOptions { | |
| self.locationManager = [[CLLocationManager alloc] init]; | |
| self.locationManager.pausesLocationUpdatesAutomatically = NO; | |
| self.locationManager.allowsBackgroundLocationUpdates = YES; | |
| self.locationManager.delegate=self; | |
| self.locationManager.desiredAccuracy=kCLLocationAccuracyBest; | |
| [self.locationManager requestAlwaysAuthorization]; | |
| return YES; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1 RCT_EXPORT_METHOD(startPostingLocationTo:(NSString *)url everyInterval:(NSInteger)interval) { | |
| 2 if (!url || url.length == 0 || interval <= 0) { | |
| 3 return; | |
| 4 } | |
| 5 | |
| 6 self.url = [NSURL URLWithString:url]; | |
| 7 | |
| 8 double seconds = interval / 1000.0; | |
| 9 | |
| 10 if (self.pollingTimer) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react' | |
| import { StyleSheet, Text, View } from 'react-native'; | |
| export default class History extends Component { | |
| render() { | |
| return ( | |
| <View style={styles.container}> | |
| <Text>History!</Text> | |
| </View> | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Exercises = [ | |
| { | |
| 'title': 'Push ups', | |
| }, | |
| { | |
| 'title': 'Bench Press', | |
| }, | |
| { | |
| 'title': 'Barbell Back Squat', | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { StyleSheet } from 'react-native' | |
| export default StyleSheet.create({ | |
| container: { | |
| alignItems: 'stretch', | |
| padding: 15, | |
| flex: 1, | |
| backgroundColor: '#fff' | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react' | |
| import { | |
| View, | |
| Text, | |
| ListView, | |
| } from 'react-native' | |
| import Exercises from './exercises' | |
| import style from './style' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { StyleSheet } from 'react-native' | |
| export default StyleSheet.create({ | |
| container: { | |
| alignItems: 'stretch', | |
| padding: 15, | |
| flex: 1, | |
| backgroundColor: '#fff' | |
| }, | |
| title: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react' | |
| import { | |
| View, | |
| Text, | |
| ListView, | |
| TouchableHighlight, | |
| } from 'react-native' | |
| import Exercise from '../exercise' | |
| import Exercises from './exercises' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Display an exercise and its associated UI inside of a modal. | |
| */ | |
| import React, {PropTypes} from 'react' | |
| import { View, Text, Modal, TouchableOpacity, Image } from 'react-native' | |
| import CloseImage from '../../assets/x.png' | |
| import style from './style' |