├── .watchmanconfig ├── .prettierignore ├── .gitattributes ├── app.json ├── .eslintrc.js ├── babel.config.js ├── android ├── app │ ├── debug.keystore │ ├── src │ │ ├── main │ │ │ ├── ic_launcher-playstore.png │ │ │ ├── res │ │ │ │ ├── drawable-hdpi │ │ │ │ │ ├── ic_cancel.png │ │ │ │ │ ├── ic_launch.png │ │ │ │ │ └── ic_notify_icon.png │ │ │ │ ├── drawable-mdpi │ │ │ │ │ ├── ic_cancel.png │ │ │ │ │ ├── ic_launch.png │ │ │ │ │ └── ic_notify_icon.png │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ ├── ic_launcher_background.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ ├── ic_launcher_background.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── drawable-xhdpi │ │ │ │ │ ├── ic_cancel.png │ │ │ │ │ ├── ic_launch.png │ │ │ │ │ └── ic_notify_icon.png │ │ │ │ ├── drawable-xxhdpi │ │ │ │ │ ├── ic_cancel.png │ │ │ │ │ ├── ic_launch.png │ │ │ │ │ └── ic_notify_icon.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ ├── ic_launcher_background.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ ├── ic_launcher_background.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── drawable-xxxhdpi │ │ │ │ │ ├── ic_cancel.png │ │ │ │ │ ├── ic_launch.png │ │ │ │ │ └── ic_notify_icon.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ ├── ic_launcher_background.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── values │ │ │ │ │ ├── styles.xml │ │ │ │ │ └── strings.xml │ │ │ │ └── mipmap-anydpi-v26 │ │ │ │ │ ├── ic_launcher.xml │ │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── mranderson │ │ │ │ │ └── locationsample │ │ │ │ │ ├── location │ │ │ │ │ ├── JSEventSender.java │ │ │ │ │ ├── LocationCoordinates.java │ │ │ │ │ ├── LocationPackage.java │ │ │ │ │ ├── Utils.java │ │ │ │ │ ├── LocationModule.java │ │ │ │ │ └── LocationUpdatesService.java │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ └── AndroidManifest.xml │ │ └── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── com │ │ │ └── hoodtocoast │ │ │ └── timing │ │ │ └── ReactNativeFlipper.java │ ├── proguard-rules.pro │ ├── build_defs.bzl │ ├── _BUCK │ └── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── settings.gradle ├── gradle.properties ├── build.gradle ├── gradlew.bat └── gradlew ├── ios ├── LocationSample │ ├── Images.xcassets │ │ ├── Contents.json │ │ └── AppIcon.appiconset │ │ │ ├── RN-LocationSample-Icon-1024.png │ │ │ ├── RN-LocationSample-Icon-20@2x.png │ │ │ ├── RN-LocationSample-Icon-20@3x.png │ │ │ ├── RN-LocationSample-Icon-29@2x.png │ │ │ ├── RN-LocationSample-Icon-29@3x.png │ │ │ ├── RN-LocationSample-Icon-40@2x.png │ │ │ ├── RN-LocationSample-Icon-40@3x.png │ │ │ ├── RN-LocationSample-Icon-60@2x.png │ │ │ ├── RN-LocationSample-Icon-60@3x.png │ │ │ └── Contents.json │ ├── AppDelegate.h │ ├── main.m │ ├── Info.plist │ └── AppDelegate.m ├── LocationSample-Bridging-Header.h ├── LocationSample.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── xcshareddata │ │ └── xcschemes │ │ │ ├── LocationSample.xcscheme │ │ │ └── LocationSample-tvOS.xcscheme │ └── project.pbxproj ├── LocationSample.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── LocationSampleTests │ ├── Info.plist │ └── HTCTimingTests.m ├── LocationSample-tvOSTests │ └── Info.plist ├── Podfile ├── LocationSample-tvOS │ └── Info.plist ├── LaunchScreen.storyboard └── Podfile.lock ├── .buckconfig ├── .prettierrc.js ├── .vscode └── settings.json ├── __tests__ └── App-test.js ├── metro.config.js ├── app ├── components │ ├── CurrentLocation │ │ ├── index.ios.js │ │ ├── index.android.js │ │ └── Stats.js │ ├── ToggleTrackingButton.js │ ├── LocationAccessButton.js │ └── Button.js ├── types.js ├── reducer.js └── hooks.js ├── package.json ├── .gitignore ├── index.js ├── .flowconfig └── README.md /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # specific for windows script files 2 | *.bat text eol=crlf -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "LocationSample", 3 | "displayName": "LocationSample" 4 | } 5 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native-community', 4 | }; 5 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/debug.keystore -------------------------------------------------------------------------------- /ios/LocationSample/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ios/LocationSample-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/ic_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/drawable-hdpi/ic_cancel.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/ic_launch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/drawable-hdpi/ic_launch.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/ic_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/drawable-mdpi/ic_cancel.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/ic_launch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/drawable-mdpi/ic_launch.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/ic_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/drawable-xhdpi/ic_cancel.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/ic_launch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/drawable-xhdpi/ic_launch.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/ic_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/drawable-xxhdpi/ic_cancel.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/ic_launch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/drawable-xxhdpi/ic_launch.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/ic_notify_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/drawable-hdpi/ic_notify_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/ic_notify_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/drawable-mdpi/ic_notify_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxxhdpi/ic_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/drawable-xxxhdpi/ic_cancel.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxxhdpi/ic_launch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/drawable-xxxhdpi/ic_launch.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // bracketSpacing: false, 3 | // jsxBracketSameLine: true, 4 | singleQuote: true, 5 | trailingComma: 'es5', 6 | arrowParens: 'avoid', 7 | }; 8 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/ic_notify_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/drawable-xhdpi/ic_notify_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/ic_notify_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/drawable-xxhdpi/ic_notify_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxxhdpi/ic_notify_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/drawable-xxxhdpi/ic_notify_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'LocationSample' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | -------------------------------------------------------------------------------- /ios/LocationSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/LocationSample/Images.xcassets/AppIcon.appiconset/RN-LocationSample-Icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/ios/LocationSample/Images.xcassets/AppIcon.appiconset/RN-LocationSample-Icon-1024.png -------------------------------------------------------------------------------- /ios/LocationSample/Images.xcassets/AppIcon.appiconset/RN-LocationSample-Icon-20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/ios/LocationSample/Images.xcassets/AppIcon.appiconset/RN-LocationSample-Icon-20@2x.png -------------------------------------------------------------------------------- /ios/LocationSample/Images.xcassets/AppIcon.appiconset/RN-LocationSample-Icon-20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/ios/LocationSample/Images.xcassets/AppIcon.appiconset/RN-LocationSample-Icon-20@3x.png -------------------------------------------------------------------------------- /ios/LocationSample/Images.xcassets/AppIcon.appiconset/RN-LocationSample-Icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/ios/LocationSample/Images.xcassets/AppIcon.appiconset/RN-LocationSample-Icon-29@2x.png -------------------------------------------------------------------------------- /ios/LocationSample/Images.xcassets/AppIcon.appiconset/RN-LocationSample-Icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/ios/LocationSample/Images.xcassets/AppIcon.appiconset/RN-LocationSample-Icon-29@3x.png -------------------------------------------------------------------------------- /ios/LocationSample/Images.xcassets/AppIcon.appiconset/RN-LocationSample-Icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/ios/LocationSample/Images.xcassets/AppIcon.appiconset/RN-LocationSample-Icon-40@2x.png -------------------------------------------------------------------------------- /ios/LocationSample/Images.xcassets/AppIcon.appiconset/RN-LocationSample-Icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/ios/LocationSample/Images.xcassets/AppIcon.appiconset/RN-LocationSample-Icon-40@3x.png -------------------------------------------------------------------------------- /ios/LocationSample/Images.xcassets/AppIcon.appiconset/RN-LocationSample-Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/ios/LocationSample/Images.xcassets/AppIcon.appiconset/RN-LocationSample-Icon-60@2x.png -------------------------------------------------------------------------------- /ios/LocationSample/Images.xcassets/AppIcon.appiconset/RN-LocationSample-Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andersryanc/ReactNative-LocationSample/HEAD/ios/LocationSample/Images.xcassets/AppIcon.appiconset/RN-LocationSample-Icon-60@3x.png -------------------------------------------------------------------------------- /ios/LocationSample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : UIResponder 5 | 6 | @property (nonatomic, strong) UIWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.format.enable": false, 3 | "typescript.suggest.enabled": false, 4 | "typescript.validate.enable": false, 5 | "javascript.validate.enable": false, 6 | "flow.pathToFlow": "${workspaceFolder}/node_modules/.bin/flow" 7 | } 8 | -------------------------------------------------------------------------------- /ios/LocationSample/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char * argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /ios/LocationSample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/LocationSample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /ios/LocationSample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /__tests__/App-test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import 'react-native'; 6 | import React from 'react'; 7 | import App from '../app'; 8 | 9 | // Note: test renderer must be required after react-native. 10 | import renderer from 'react-test-renderer'; 11 | 12 | it.skip('renders correctly', () => { 13 | renderer.create(); 14 | }); 15 | -------------------------------------------------------------------------------- /metro.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Metro configuration for React Native 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | */ 7 | 8 | module.exports = { 9 | transformer: { 10 | getTransformOptions: async () => ({ 11 | transform: { 12 | experimentalImportSupport: false, 13 | inlineRequires: false, 14 | }, 15 | }), 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/mranderson/locationsample/location/JSEventSender.java: -------------------------------------------------------------------------------- 1 | package com.mranderson.locationsample.location; 2 | 3 | import androidx.annotation.Nullable; 4 | 5 | import com.facebook.react.bridge.ReactContext; 6 | import com.facebook.react.bridge.WritableMap; 7 | 8 | public interface JSEventSender { 9 | void sendEventToJS(ReactContext reactContext, String eventName, @Nullable WritableMap params); 10 | } -------------------------------------------------------------------------------- /android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /app/components/CurrentLocation/index.ios.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | * @flow 4 | */ 5 | 6 | import type { TimingState, TimingDispatch } from '../../types'; 7 | 8 | import React from 'react'; 9 | import { useLocationTracking } from '../../hooks'; 10 | import Stats from './Stats'; 11 | 12 | type Props = { 13 | state: TimingState, 14 | dispatch: TimingDispatch, 15 | }; 16 | 17 | const CurrentLocation = ({ state, dispatch }: Props) => { 18 | useLocationTracking(state, dispatch); 19 | return ; 20 | }; 21 | 22 | export default CurrentLocation; 23 | -------------------------------------------------------------------------------- /app/components/CurrentLocation/index.android.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | * @flow 4 | */ 5 | 6 | import type { TimingState, TimingDispatch } from '../../types'; 7 | 8 | import React from 'react'; 9 | import { useNativeLocationTracking } from '../../hooks'; 10 | import Stats from './Stats'; 11 | 12 | type Props = { 13 | state: TimingState, 14 | dispatch: TimingDispatch, 15 | }; 16 | 17 | const CurrentLocation = ({ state, dispatch }: Props) => { 18 | useNativeLocationTracking(state, dispatch); 19 | return ; 20 | }; 21 | 22 | export default CurrentLocation; 23 | -------------------------------------------------------------------------------- /android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /ios/LocationSampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | LocationSample 3 | 4 | Launch activity 5 | Location unknown 6 | Location Updates 7 | 8 | Location permission is needed for core functionality 9 | Permission was denied, but is needed for core 10 | functionality. 11 | Settings 12 | OK 13 | Request location updates 14 | Remove location updates 15 | 16 | Last Update: %1$s 17 | 18 | -------------------------------------------------------------------------------- /app/components/CurrentLocation/Stats.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | * @flow 4 | */ 5 | 6 | import type { TimingState, TimingDispatch } from '../../types'; 7 | 8 | import React from 'react'; 9 | import { StyleSheet, Text, View } from 'react-native'; 10 | 11 | type Props = { 12 | state: TimingState, 13 | dispatch: TimingDispatch, 14 | }; 15 | 16 | const Stats = ({ state, dispatch }: Props) => { 17 | return ( 18 | 19 | Running: {state.running ? 'Yes' : 'No'} 20 | Granted: {state.granted ? 'Yes' : 'No'} 21 | 22 | Current Location:{' '} 23 | {state.position ? JSON.stringify(state.position) : 'None'} 24 | 25 | 26 | ); 27 | }; 28 | 29 | const styles = StyleSheet.create({ 30 | container: { 31 | marginTop: 24, 32 | }, 33 | }); 34 | 35 | export default Stats; 36 | -------------------------------------------------------------------------------- /ios/LocationSample-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/mranderson/locationsample/location/LocationCoordinates.java: -------------------------------------------------------------------------------- 1 | package com.mranderson.locationsample.location; 2 | 3 | public class LocationCoordinates { 4 | private double latitude; 5 | private double longitude; 6 | private long timestamp; 7 | 8 | double getLatitude() { 9 | return latitude; 10 | } 11 | 12 | LocationCoordinates setLatitude(double latitude) { 13 | this.latitude = latitude; 14 | return this; 15 | } 16 | 17 | double getLongitude() { 18 | return longitude; 19 | } 20 | 21 | LocationCoordinates setLongitude(double longitude) { 22 | this.longitude = longitude; 23 | return this; 24 | } 25 | 26 | long getTimestamp() { 27 | return timestamp; 28 | } 29 | 30 | LocationCoordinates setTimestamp(long timestamp) { 31 | this.timestamp = timestamp; 32 | return this; 33 | } 34 | } -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | require_relative '../node_modules/react-native/scripts/react_native_pods' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | platform :ios, '10.0' 5 | 6 | target 'LocationSample' do 7 | config = use_native_modules! 8 | 9 | use_react_native!(:path => config["reactNativePath"]) 10 | 11 | target 'LocationSampleTests' do 12 | inherit! :complete 13 | # Pods for testing 14 | end 15 | 16 | # Enables Flipper. 17 | # 18 | # Note that if you have use_frameworks! enabled, Flipper will not work and 19 | # you should disable these next few lines. 20 | use_flipper! 21 | post_install do |installer| 22 | flipper_post_install(installer) 23 | end 24 | end 25 | 26 | target 'LocationSample-tvOS' do 27 | # Pods for LocationSample-tvOS 28 | 29 | target 'LocationSample-tvOSTests' do 30 | inherit! :search_paths 31 | # Pods for testing 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /app/components/ToggleTrackingButton.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | * @flow 4 | */ 5 | 6 | import type { TimingState, TimingDispatch } from '../../types'; 7 | 8 | import React from 'react'; 9 | import Button from './Button'; 10 | import { Actions } from '../reducer'; 11 | 12 | type Props = { 13 | state: TimingState, 14 | dispatch: TimingDispatch, 15 | }; 16 | 17 | const ToggleTrackingButton = ({ state, dispatch }: Props) => { 18 | if (state.running) { 19 | return ( 20 |