/node_modules/react-native/Libraries/Image/RelativeImageStub'
38 |
39 | suppress_type=$FlowIssue
40 | suppress_type=$FlowFixMe
41 | suppress_type=$FlowFixMeProps
42 | suppress_type=$FlowFixMeState
43 |
44 | [lints]
45 | sketchy-null-number=warn
46 | sketchy-null-mixed=warn
47 | sketchy-number=warn
48 | untyped-type-import=warn
49 | nonstrict-import=warn
50 | deprecated-type=warn
51 | unsafe-getters-setters=warn
52 | unnecessary-invariant=warn
53 | signature-verification-failure=warn
54 |
55 | [strict]
56 | deprecated-type
57 | nonstrict-import
58 | sketchy-null
59 | unclear-type
60 | unsafe-getters-setters
61 | untyped-import
62 | untyped-type-import
63 |
64 | [version]
65 | ^0.158.0
66 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # Xcode
6 | #
7 | build/
8 | *.pbxuser
9 | !default.pbxuser
10 | *.mode1v3
11 | !default.mode1v3
12 | *.mode2v3
13 | !default.mode2v3
14 | *.perspectivev3
15 | !default.perspectivev3
16 | xcuserdata
17 | *.xccheckout
18 | *.moved-aside
19 | DerivedData
20 | *.hmap
21 | *.ipa
22 | *.xcuserstate
23 |
24 | # Android/IntelliJ
25 | #
26 | build/
27 | .idea
28 | .gradle
29 | local.properties
30 | *.iml
31 | *.hprof
32 |
33 | # node.js
34 | #
35 | node_modules/
36 | npm-debug.log
37 | yarn-error.log
38 |
39 | # BUCK
40 | buck-out/
41 | \.buckd/
42 | *.keystore
43 | !debug.keystore
44 |
45 | # fastlane
46 | #
47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
48 | # screenshots whenever they are needed.
49 | # For more information about the recommended setup visit:
50 | # https://docs.fastlane.tools/best-practices/source-control/
51 |
52 | */fastlane/report.xml
53 | */fastlane/Preview.html
54 | */fastlane/screenshots
55 |
56 | # Bundle artifact
57 | *.jsbundle
58 |
59 | # CocoaPods
60 | /ios/Pods/
61 |
--------------------------------------------------------------------------------
/example/.prettierrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | bracketSpacing: false,
3 | jsxBracketSameLine: true,
4 | singleQuote: true,
5 | trailingComma: 'all',
6 | arrowParens: 'avoid',
7 | };
8 |
--------------------------------------------------------------------------------
/example/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/example/App.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Sample React Native App
3 | * https://github.com/facebook/react-native
4 | *
5 | * @format
6 | * @flow strict-local
7 | */
8 |
9 | import React, {useEffect} from 'react';
10 | import {SafeAreaView, useColorScheme} from 'react-native';
11 | import {Colors} from 'react-native/Libraries/NewAppScreen';
12 | import NavigationComponent from './NavigationComponent';
13 | import {PermissionsAndroid} from 'react-native';
14 |
15 | const App = () => {
16 | const isDarkMode = useColorScheme() === 'dark';
17 |
18 | const backgroundStyle = {
19 | backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
20 | flex: 1,
21 | };
22 |
23 | useEffect(() => {
24 | const requestLocationPermission = async () => {
25 | try {
26 | await PermissionsAndroid.request(
27 | PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
28 | {
29 | title: 'Example App',
30 | message: 'Example App access to your location ',
31 | },
32 | );
33 | } catch (err) {
34 | console.warn(err);
35 | }
36 | };
37 |
38 | requestLocationPermission();
39 | }, []);
40 |
41 | return (
42 |
43 |
47 |
48 | );
49 | };
50 |
51 | export default App;
52 |
--------------------------------------------------------------------------------
/example/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 |
3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4 | ruby '2.7.4'
5 |
6 | gem 'cocoapods', '~> 1.11', '>= 1.11.2'
7 |
--------------------------------------------------------------------------------
/example/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | CFPropertyList (3.0.5)
5 | rexml
6 | activesupport (6.1.4.4)
7 | concurrent-ruby (~> 1.0, >= 1.0.2)
8 | i18n (>= 1.6, < 2)
9 | minitest (>= 5.1)
10 | tzinfo (~> 2.0)
11 | zeitwerk (~> 2.3)
12 | addressable (2.8.0)
13 | public_suffix (>= 2.0.2, < 5.0)
14 | algoliasearch (1.27.5)
15 | httpclient (~> 2.8, >= 2.8.3)
16 | json (>= 1.5.1)
17 | atomos (0.1.3)
18 | claide (1.1.0)
19 | cocoapods (1.11.2)
20 | addressable (~> 2.8)
21 | claide (>= 1.0.2, < 2.0)
22 | cocoapods-core (= 1.11.2)
23 | cocoapods-deintegrate (>= 1.0.3, < 2.0)
24 | cocoapods-downloader (>= 1.4.0, < 2.0)
25 | cocoapods-plugins (>= 1.0.0, < 2.0)
26 | cocoapods-search (>= 1.0.0, < 2.0)
27 | cocoapods-trunk (>= 1.4.0, < 2.0)
28 | cocoapods-try (>= 1.1.0, < 2.0)
29 | colored2 (~> 3.1)
30 | escape (~> 0.0.4)
31 | fourflusher (>= 2.3.0, < 3.0)
32 | gh_inspector (~> 1.0)
33 | molinillo (~> 0.8.0)
34 | nap (~> 1.0)
35 | ruby-macho (>= 1.0, < 3.0)
36 | xcodeproj (>= 1.21.0, < 2.0)
37 | cocoapods-core (1.11.2)
38 | activesupport (>= 5.0, < 7)
39 | addressable (~> 2.8)
40 | algoliasearch (~> 1.0)
41 | concurrent-ruby (~> 1.1)
42 | fuzzy_match (~> 2.0.4)
43 | nap (~> 1.0)
44 | netrc (~> 0.11)
45 | public_suffix (~> 4.0)
46 | typhoeus (~> 1.0)
47 | cocoapods-deintegrate (1.0.5)
48 | cocoapods-downloader (1.5.1)
49 | cocoapods-plugins (1.0.0)
50 | nap
51 | cocoapods-search (1.0.1)
52 | cocoapods-trunk (1.6.0)
53 | nap (>= 0.8, < 2.0)
54 | netrc (~> 0.11)
55 | cocoapods-try (1.2.0)
56 | colored2 (3.1.2)
57 | concurrent-ruby (1.1.9)
58 | escape (0.0.4)
59 | ethon (0.15.0)
60 | ffi (>= 1.15.0)
61 | ffi (1.15.5)
62 | fourflusher (2.3.1)
63 | fuzzy_match (2.0.4)
64 | gh_inspector (1.1.3)
65 | httpclient (2.8.3)
66 | i18n (1.8.11)
67 | concurrent-ruby (~> 1.0)
68 | json (2.6.1)
69 | minitest (5.15.0)
70 | molinillo (0.8.0)
71 | nanaimo (0.3.0)
72 | nap (1.1.0)
73 | netrc (0.11.0)
74 | public_suffix (4.0.6)
75 | rexml (3.2.5)
76 | ruby-macho (2.5.1)
77 | typhoeus (1.4.0)
78 | ethon (>= 0.9.0)
79 | tzinfo (2.0.4)
80 | concurrent-ruby (~> 1.0)
81 | xcodeproj (1.21.0)
82 | CFPropertyList (>= 2.3.3, < 4.0)
83 | atomos (~> 0.1.3)
84 | claide (>= 1.0.2, < 2.0)
85 | colored2 (~> 3.1)
86 | nanaimo (~> 0.3.0)
87 | rexml (~> 3.2.4)
88 | zeitwerk (2.5.3)
89 |
90 | PLATFORMS
91 | ruby
92 |
93 | DEPENDENCIES
94 | cocoapods (~> 1.11, >= 1.11.2)
95 |
96 | RUBY VERSION
97 | ruby 2.7.4p191
98 |
99 | BUNDLED WITH
100 | 2.2.27
101 |
--------------------------------------------------------------------------------
/example/NavigationComponent.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable comma-dangle */
2 | import React from 'react';
3 | import {StyleSheet, View} from 'react-native';
4 | import MapboxNavigation from '@homee/react-native-mapbox-navigation';
5 |
6 | const Navigation = props => {
7 | const {origin, destination} = props;
8 |
9 | return (
10 |
11 |
12 | {
20 | console.log('onLocationChange', event.nativeEvent);
21 | }}
22 | onRouteProgressChange={event => {
23 | console.log('onRouteProgressChange', event.nativeEvent);
24 | }}
25 | onError={event => {
26 | const {message} = event.nativeEvent;
27 | // eslint-disable-next-line no-alert
28 | alert(message);
29 | }}
30 | onArrive={() => {
31 | // eslint-disable-next-line no-alert
32 | alert('You have reached your destination');
33 | }}
34 | onCancelNavigation={event => {
35 | alert('Cancelled navigation event');
36 | }}
37 | />
38 |
39 |
40 | );
41 | };
42 |
43 | const styles = StyleSheet.create({
44 | container: {
45 | flex: 1,
46 | display: 'flex',
47 | flexDirection: 'column',
48 | justifyContent: 'space-between',
49 | height: '100%',
50 | },
51 | mapContainer: {
52 | flex: 1,
53 | },
54 | });
55 |
56 | export default Navigation;
57 |
--------------------------------------------------------------------------------
/example/__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('renders correctly', () => {
13 | renderer.create();
14 | });
15 |
--------------------------------------------------------------------------------
/example/_bundle/config:
--------------------------------------------------------------------------------
1 | BUNDLE_PATH: "vendor/bundle"
2 | BUNDLE_FORCE_RUBY_PLATFORM: 1
3 |
--------------------------------------------------------------------------------
/example/_ruby-version:
--------------------------------------------------------------------------------
1 | 2.7.4
2 |
--------------------------------------------------------------------------------
/example/android/app/_BUCK:
--------------------------------------------------------------------------------
1 | # To learn about Buck see [Docs](https://buckbuild.com/).
2 | # To run your application with Buck:
3 | # - install Buck
4 | # - `npm start` - to start the packager
5 | # - `cd android`
6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8 | # - `buck install -r android/app` - compile, install and run application
9 | #
10 |
11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12 |
13 | lib_deps = []
14 |
15 | create_aar_targets(glob(["libs/*.aar"]))
16 |
17 | create_jar_targets(glob(["libs/*.jar"]))
18 |
19 | android_library(
20 | name = "all-libs",
21 | exported_deps = lib_deps,
22 | )
23 |
24 | android_library(
25 | name = "app-code",
26 | srcs = glob([
27 | "src/main/java/**/*.java",
28 | ]),
29 | deps = [
30 | ":all-libs",
31 | ":build_config",
32 | ":res",
33 | ],
34 | )
35 |
36 | android_build_config(
37 | name = "build_config",
38 | package = "com.basicapp",
39 | )
40 |
41 | android_resource(
42 | name = "res",
43 | package = "com.basicapp",
44 | res = "src/main/res",
45 | )
46 |
47 | android_binary(
48 | name = "app",
49 | keystore = "//android/keystores:debug",
50 | manifest = "src/main/AndroidManifest.xml",
51 | package_type = "debug",
52 | deps = [
53 | ":app-code",
54 | ],
55 | )
56 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 |
3 | import com.android.build.OutputFile
4 |
5 | /**
6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7 | * and bundleReleaseJsAndAssets).
8 | * These basically call `react-native bundle` with the correct arguments during the Android build
9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10 | * bundle directly from the development server. Below you can see all the possible configurations
11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the
12 | * `apply from: "../../node_modules/react-native/react.gradle"` line.
13 | *
14 | * project.ext.react = [
15 | * // the name of the generated asset file containing your JS bundle
16 | * bundleAssetName: "index.android.bundle",
17 | *
18 | * // the entry file for bundle generation. If none specified and
19 | * // "index.android.js" exists, it will be used. Otherwise "index.js" is
20 | * // default. Can be overridden with ENTRY_FILE environment variable.
21 | * entryFile: "index.android.js",
22 | *
23 | * // https://reactnative.dev/docs/performance#enable-the-ram-format
24 | * bundleCommand: "ram-bundle",
25 | *
26 | * // whether to bundle JS and assets in debug mode
27 | * bundleInDebug: false,
28 | *
29 | * // whether to bundle JS and assets in release mode
30 | * bundleInRelease: true,
31 | *
32 | * // whether to bundle JS and assets in another build variant (if configured).
33 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
34 | * // The configuration property can be in the following formats
35 | * // 'bundleIn${productFlavor}${buildType}'
36 | * // 'bundleIn${buildType}'
37 | * // bundleInFreeDebug: true,
38 | * // bundleInPaidRelease: true,
39 | * // bundleInBeta: true,
40 | *
41 | * // whether to disable dev mode in custom build variants (by default only disabled in release)
42 | * // for example: to disable dev mode in the staging build type (if configured)
43 | * devDisabledInStaging: true,
44 | * // The configuration property can be in the following formats
45 | * // 'devDisabledIn${productFlavor}${buildType}'
46 | * // 'devDisabledIn${buildType}'
47 | *
48 | * // the root of your project, i.e. where "package.json" lives
49 | * root: "../../",
50 | *
51 | * // where to put the JS bundle asset in debug mode
52 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
53 | *
54 | * // where to put the JS bundle asset in release mode
55 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
56 | *
57 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
58 | * // require('./image.png')), in debug mode
59 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
60 | *
61 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
62 | * // require('./image.png')), in release mode
63 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
64 | *
65 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
66 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
67 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle
68 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
69 | * // for example, you might want to remove it from here.
70 | * inputExcludes: ["android/**", "ios/**"],
71 | *
72 | * // override which node gets called and with what additional arguments
73 | * nodeExecutableAndArgs: ["node"],
74 | *
75 | * // supply additional arguments to the packager
76 | * extraPackagerArgs: []
77 | * ]
78 | */
79 |
80 | project.ext.react = [
81 | enableHermes: false, // clean and rebuild if changing
82 | ]
83 |
84 | apply from: "../../node_modules/react-native/react.gradle"
85 |
86 | /**
87 | * Set this to true to create two separate APKs instead of one:
88 | * - An APK that only works on ARM devices
89 | * - An APK that only works on x86 devices
90 | * The advantage is the size of the APK is reduced by about 4MB.
91 | * Upload all the APKs to the Play Store and people will download
92 | * the correct one based on the CPU architecture of their device.
93 | */
94 | def enableSeparateBuildPerCPUArchitecture = false
95 |
96 | /**
97 | * Run Proguard to shrink the Java bytecode in release builds.
98 | */
99 | def enableProguardInReleaseBuilds = false
100 |
101 | /**
102 | * The preferred build flavor of JavaScriptCore.
103 | *
104 | * For example, to use the international variant, you can use:
105 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
106 | *
107 | * The international variant includes ICU i18n library and necessary data
108 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
109 | * give correct results when using with locales other than en-US. Note that
110 | * this variant is about 6MiB larger per architecture than default.
111 | */
112 | def jscFlavor = 'org.webkit:android-jsc:+'
113 |
114 | /**
115 | * Whether to enable the Hermes VM.
116 | *
117 | * This should be set on project.ext.react and that value will be read here. If it is not set
118 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
119 | * and the benefits of using Hermes will therefore be sharply reduced.
120 | */
121 | def enableHermes = project.ext.react.get("enableHermes", false);
122 |
123 | /**
124 | * Architectures to build native code for in debug.
125 | */
126 | def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures")
127 |
128 | android {
129 | ndkVersion rootProject.ext.ndkVersion
130 |
131 | compileSdkVersion rootProject.ext.compileSdkVersion
132 |
133 | defaultConfig {
134 | applicationId "com.basicapp"
135 | minSdkVersion rootProject.ext.minSdkVersion
136 | targetSdkVersion rootProject.ext.targetSdkVersion
137 | versionCode 1
138 | versionName "1.0"
139 | }
140 | splits {
141 | abi {
142 | reset()
143 | enable enableSeparateBuildPerCPUArchitecture
144 | universalApk false // If true, also generate a universal APK
145 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
146 | }
147 | }
148 | packagingOptions {
149 | pickFirst '**/*.so'
150 | }
151 | signingConfigs {
152 | debug {
153 | storeFile file('debug.keystore')
154 | storePassword 'android'
155 | keyAlias 'androiddebugkey'
156 | keyPassword 'android'
157 | }
158 | }
159 | buildTypes {
160 | debug {
161 | signingConfig signingConfigs.debug
162 | if (nativeArchitectures) {
163 | ndk {
164 | abiFilters nativeArchitectures.split(',')
165 | }
166 | }
167 | }
168 | release {
169 | // Caution! In production, you need to generate your own keystore file.
170 | // see https://reactnative.dev/docs/signed-apk-android.
171 | signingConfig signingConfigs.debug
172 | minifyEnabled enableProguardInReleaseBuilds
173 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
174 | }
175 | }
176 |
177 | // applicationVariants are e.g. debug, release
178 | applicationVariants.all { variant ->
179 | variant.outputs.each { output ->
180 | // For each separate APK per architecture, set a unique version code as described here:
181 | // https://developer.android.com/studio/build/configure-apk-splits.html
182 | // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
183 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
184 | def abi = output.getFilter(OutputFile.ABI)
185 | if (abi != null) { // null for the universal-debug, universal-release variants
186 | output.versionCodeOverride =
187 | defaultConfig.versionCode * 1000 + versionCodes.get(abi)
188 | }
189 |
190 | }
191 | }
192 | }
193 |
194 | dependencies {
195 | implementation fileTree(dir: "libs", include: ["*.jar"])
196 | //noinspection GradleDynamicVersion
197 | implementation "com.facebook.react:react-native:+" // From node_modules
198 |
199 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
200 |
201 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
202 | exclude group:'com.facebook.fbjni'
203 | }
204 |
205 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
206 | exclude group:'com.facebook.flipper'
207 | exclude group:'com.squareup.okhttp3', module:'okhttp'
208 | }
209 |
210 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
211 | exclude group:'com.facebook.flipper'
212 | }
213 |
214 | if (enableHermes) {
215 | def hermesPath = "../../node_modules/hermes-engine/android/";
216 | debugImplementation files(hermesPath + "hermes-debug.aar")
217 | releaseImplementation files(hermesPath + "hermes-release.aar")
218 | } else {
219 | implementation jscFlavor
220 | }
221 |
222 | implementation project(':mapboxnavigation')
223 | }
224 |
225 | // Run this once to be able to run the application with BUCK
226 | // puts all compile dependencies into folder libs for BUCK to use
227 | task copyDownloadableDepsToLibs(type: Copy) {
228 | from configurations.implementation
229 | into 'libs'
230 | }
231 |
232 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
233 |
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/android/app/debug.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/homeeondemand/react-native-mapbox-navigation/d0f729ce8665020145be7024c50bc3867e21001d/example/android/app/debug.keystore
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/java/com/basicapp/ReactNativeFlipper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the LICENSE file in the root
5 | * directory of this source tree.
6 | */
7 | package com.basicapp;
8 |
9 | import android.content.Context;
10 | import com.facebook.flipper.android.AndroidFlipperClient;
11 | import com.facebook.flipper.android.utils.FlipperUtils;
12 | import com.facebook.flipper.core.FlipperClient;
13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping;
17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
20 | import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
21 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
22 | import com.facebook.react.ReactInstanceManager;
23 | import com.facebook.react.bridge.ReactContext;
24 | import com.facebook.react.modules.network.NetworkingModule;
25 | import okhttp3.OkHttpClient;
26 |
27 | public class ReactNativeFlipper {
28 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
29 | if (FlipperUtils.shouldEnableFlipper(context)) {
30 | final FlipperClient client = AndroidFlipperClient.getInstance(context);
31 |
32 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
33 | client.addPlugin(new ReactFlipperPlugin());
34 | client.addPlugin(new DatabasesFlipperPlugin(context));
35 | client.addPlugin(new SharedPreferencesFlipperPlugin(context));
36 | client.addPlugin(CrashReporterPlugin.getInstance());
37 |
38 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
39 | NetworkingModule.setCustomClientBuilder(
40 | new NetworkingModule.CustomClientBuilder() {
41 | @Override
42 | public void apply(OkHttpClient.Builder builder) {
43 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
44 | }
45 | });
46 | client.addPlugin(networkFlipperPlugin);
47 | client.start();
48 |
49 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
50 | // Hence we run if after all native modules have been initialized
51 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
52 | if (reactContext == null) {
53 | reactInstanceManager.addReactInstanceEventListener(
54 | new ReactInstanceManager.ReactInstanceEventListener() {
55 | @Override
56 | public void onReactContextInitialized(ReactContext reactContext) {
57 | reactInstanceManager.removeReactInstanceEventListener(this);
58 | reactContext.runOnNativeModulesQueueThread(
59 | new Runnable() {
60 | @Override
61 | public void run() {
62 | client.addPlugin(new FrescoFlipperPlugin());
63 | }
64 | });
65 | }
66 | });
67 | } else {
68 | client.addPlugin(new FrescoFlipperPlugin());
69 | }
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
16 |
22 |
23 |
24 |
25 |
26 |
27 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/basicapp/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.basicapp;
2 |
3 | import com.facebook.react.ReactActivity;
4 |
5 | public class MainActivity extends ReactActivity {
6 |
7 | /**
8 | * Returns the name of the main component registered from JavaScript. This is used to schedule
9 | * rendering of the component.
10 | */
11 | @Override
12 | protected String getMainComponentName() {
13 | return "BasicApp";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/basicapp/MainApplication.java:
--------------------------------------------------------------------------------
1 | package com.basicapp;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 | import com.facebook.react.PackageList;
6 | import com.facebook.react.ReactApplication;
7 | import com.facebook.react.ReactInstanceManager;
8 | import com.facebook.react.ReactNativeHost;
9 | import com.facebook.react.ReactPackage;
10 | import com.facebook.soloader.SoLoader;
11 | import java.lang.reflect.InvocationTargetException;
12 | import java.util.List;
13 | import com.homee.mapboxnavigation.MapboxNavigationPackage;
14 |
15 | public class MainApplication extends Application implements ReactApplication {
16 |
17 | private final ReactNativeHost mReactNativeHost =
18 | new ReactNativeHost(this) {
19 | @Override
20 | public boolean getUseDeveloperSupport() {
21 | return BuildConfig.DEBUG;
22 | }
23 |
24 | @Override
25 | protected List getPackages() {
26 | @SuppressWarnings("UnnecessaryLocalVariable")
27 | List packages = new PackageList(this).getPackages();
28 | // Packages that cannot be autolinked yet can be added manually here, for example:
29 | packages.add(new MapboxNavigationPackage());
30 | return packages;
31 | }
32 |
33 | @Override
34 | protected String getJSMainModuleName() {
35 | return "index";
36 | }
37 | };
38 |
39 | @Override
40 | public ReactNativeHost getReactNativeHost() {
41 | return mReactNativeHost;
42 | }
43 |
44 | @Override
45 | public void onCreate() {
46 | super.onCreate();
47 | SoLoader.init(this, /* native exopackage */ false);
48 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
49 | }
50 |
51 | /**
52 | * Loads Flipper in React Native templates. Call this in the onCreate method with something like
53 | * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
54 | *
55 | * @param context
56 | * @param reactInstanceManager
57 | */
58 | private static void initializeFlipper(
59 | Context context, ReactInstanceManager reactInstanceManager) {
60 | if (BuildConfig.DEBUG) {
61 | try {
62 | /*
63 | We use reflection here to pick up the class that initializes Flipper,
64 | since Flipper library is not available in release mode
65 | */
66 | Class> aClass = Class.forName("com.basicapp.ReactNativeFlipper");
67 | aClass
68 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
69 | .invoke(null, context, reactInstanceManager);
70 | } catch (ClassNotFoundException e) {
71 | e.printStackTrace();
72 | } catch (NoSuchMethodException e) {
73 | e.printStackTrace();
74 | } catch (IllegalAccessException e) {
75 | e.printStackTrace();
76 | } catch (InvocationTargetException e) {
77 | e.printStackTrace();
78 | }
79 | }
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/rn_edit_text_material.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
21 |
22 |
23 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/homeeondemand/react-native-mapbox-navigation/d0f729ce8665020145be7024c50bc3867e21001d/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/homeeondemand/react-native-mapbox-navigation/d0f729ce8665020145be7024c50bc3867e21001d/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/homeeondemand/react-native-mapbox-navigation/d0f729ce8665020145be7024c50bc3867e21001d/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/homeeondemand/react-native-mapbox-navigation/d0f729ce8665020145be7024c50bc3867e21001d/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/homeeondemand/react-native-mapbox-navigation/d0f729ce8665020145be7024c50bc3867e21001d/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/homeeondemand/react-native-mapbox-navigation/d0f729ce8665020145be7024c50bc3867e21001d/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/homeeondemand/react-native-mapbox-navigation/d0f729ce8665020145be7024c50bc3867e21001d/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/homeeondemand/react-native-mapbox-navigation/d0f729ce8665020145be7024c50bc3867e21001d/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/homeeondemand/react-native-mapbox-navigation/d0f729ce8665020145be7024c50bc3867e21001d/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/homeeondemand/react-native-mapbox-navigation/d0f729ce8665020145be7024c50bc3867e21001d/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | BasicApp
3 |
4 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext {
5 | buildToolsVersion = "30.0.2"
6 | minSdkVersion = 21
7 | compileSdkVersion = 31
8 | targetSdkVersion = 31
9 | ndkVersion = "21.4.7075529"
10 | }
11 | repositories {
12 | google()
13 | mavenCentral()
14 | }
15 | dependencies {
16 | classpath("com.android.tools.build:gradle:4.2.2")
17 | // NOTE: Do not place your application dependencies here; they belong
18 | // in the individual module build.gradle files
19 | }
20 | }
21 |
22 | allprojects {
23 | repositories {
24 | maven {
25 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
26 | url("$rootDir/../node_modules/react-native/android")
27 | }
28 | maven {
29 | // Android JSC is installed from npm
30 | url("$rootDir/../node_modules/jsc-android/dist")
31 | }
32 | mavenCentral {
33 | // We don't want to fetch react-native from Maven Central as there are
34 | // older versions over there.
35 | content {
36 | excludeGroup "com.facebook.react"
37 | }
38 | }
39 | google()
40 | maven { url 'https://www.jitpack.io' }
41 | maven {
42 | url 'https://api.mapbox.com/downloads/v2/releases/maven'
43 | authentication {
44 | basic(BasicAuthentication)
45 | }
46 | credentials {
47 | // Do not change the username below.
48 | // This should always be `mapbox` (not your username).
49 | username = "mapbox"
50 | // Use the secret token you stored in gradle.properties as the password
51 | password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
52 | }
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx1024m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | # AndroidX package structure to make it clearer which packages are bundled with the
21 | # Android operating system, and which are packaged with your app's APK
22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
23 | android.useAndroidX=true
24 | # Automatically convert third-party libraries to use AndroidX
25 | android.enableJetifier=true
26 |
27 | # Version of flipper SDK to use with React Native
28 | FLIPPER_VERSION=0.99.0
29 |
30 | MAPBOX_DOWNLOADS_TOKEN= sk.eyJ1Ijoiam9yZ2VxdWV2ZWRveCIsImEiOiJja29ib3oycWIyN2Z3MnZvbmc0eGttOTI0In0.Wsd8kBSIh6RkhivVUWm3cw
31 |
32 | org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=4096m -XX:+HeapDumpOnOutOfMemoryError
33 | org.gradle.daemon=true
34 | org.gradle.parallel=true
35 | org.gradle.configureondemand=true.
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/homeeondemand/react-native-mapbox-navigation/d0f729ce8665020145be7024c50bc3867e21001d/example/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/example/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 |
86 | # Determine the Java command to use to start the JVM.
87 | if [ -n "$JAVA_HOME" ] ; then
88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
89 | # IBM's JDK on AIX uses strange locations for the executables
90 | JAVACMD="$JAVA_HOME/jre/sh/java"
91 | else
92 | JAVACMD="$JAVA_HOME/bin/java"
93 | fi
94 | if [ ! -x "$JAVACMD" ] ; then
95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
96 |
97 | Please set the JAVA_HOME variable in your environment to match the
98 | location of your Java installation."
99 | fi
100 | else
101 | JAVACMD="java"
102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
103 |
104 | Please set the JAVA_HOME variable in your environment to match the
105 | location of your Java installation."
106 | fi
107 |
108 | # Increase the maximum file descriptors if we can.
109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
110 | MAX_FD_LIMIT=`ulimit -H -n`
111 | if [ $? -eq 0 ] ; then
112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
113 | MAX_FD="$MAX_FD_LIMIT"
114 | fi
115 | ulimit -n $MAX_FD
116 | if [ $? -ne 0 ] ; then
117 | warn "Could not set maximum file descriptor limit: $MAX_FD"
118 | fi
119 | else
120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
121 | fi
122 | fi
123 |
124 | # For Darwin, add options to specify how the application appears in the dock
125 | if $darwin; then
126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
127 | fi
128 |
129 | # For Cygwin or MSYS, switch paths to Windows format before running java
130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133 |
134 | JAVACMD=`cygpath --unix "$JAVACMD"`
135 |
136 | # We build the pattern for arguments to be converted via cygpath
137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
138 | SEP=""
139 | for dir in $ROOTDIRSRAW ; do
140 | ROOTDIRS="$ROOTDIRS$SEP$dir"
141 | SEP="|"
142 | done
143 | OURCYGPATTERN="(^($ROOTDIRS))"
144 | # Add a user-defined pattern to the cygpath arguments
145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
147 | fi
148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
149 | i=0
150 | for arg in "$@" ; do
151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
153 |
154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
156 | else
157 | eval `echo args$i`="\"$arg\""
158 | fi
159 | i=`expr $i + 1`
160 | done
161 | case $i in
162 | 0) set -- ;;
163 | 1) set -- "$args0" ;;
164 | 2) set -- "$args0" "$args1" ;;
165 | 3) set -- "$args0" "$args1" "$args2" ;;
166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
172 | esac
173 | fi
174 |
175 | # Escape application args
176 | save () {
177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178 | echo " "
179 | }
180 | APP_ARGS=`save "$@"`
181 |
182 | # Collect all arguments for the java command, following the shell quoting and substitution rules
183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
184 |
185 | exec "$JAVACMD" "$@"
186 |
--------------------------------------------------------------------------------
/example/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'BasicApp'
2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
3 | include ':app'
4 |
5 | include ':mapboxnavigation'
6 | project(':mapboxnavigation').projectDir = new File(rootProject.projectDir, '../../android')
--------------------------------------------------------------------------------
/example/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "BasicApp",
3 | "displayName": "BasicApp"
4 | }
--------------------------------------------------------------------------------
/example/babel.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Metro configuration for React Native
3 | * https://github.com/facebook/react-native
4 | *
5 | * @format
6 | */
7 |
8 | const path = require('path');
9 | const pak = require('../package.json');
10 |
11 | module.exports = {
12 | presets: ['module:metro-react-native-babel-preset'],
13 | plugins: [
14 | [
15 | 'module-resolver',
16 | {
17 | extensions: ['.tsx', '.ts', '.js', '.json'],
18 | alias: {
19 | [pak.name]: path.join(__dirname, '..', pak.source),
20 | },
21 | },
22 | ],
23 | ],
24 | };
25 |
--------------------------------------------------------------------------------
/example/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @format
3 | */
4 |
5 | import {AppRegistry} from 'react-native';
6 | import App from './App';
7 | import {name as appName} from './app.json';
8 |
9 | AppRegistry.registerComponent(appName, () => App);
10 |
--------------------------------------------------------------------------------
/example/ios/BasicApp-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 |
--------------------------------------------------------------------------------
/example/ios/BasicApp.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 54;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 00E356F31AD99517003FC87E /* BasicAppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* BasicAppTests.m */; };
11 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
12 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
14 | 2E2D5B56C32B148E16436AAD /* libPods-BasicApp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA5E5B1A36C1EFD40B9FE59A /* libPods-BasicApp.a */; };
15 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
16 | CF01C0932798908E009932D0 /* BridgeHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF01C0922798908E009932D0 /* BridgeHeader.swift */; };
17 | E1B8FFE0CC904B260DFE309F /* libPods-BasicApp-BasicAppTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D7DB328487C5F842F76563DF /* libPods-BasicApp-BasicAppTests.a */; };
18 | /* End PBXBuildFile section */
19 |
20 | /* Begin PBXContainerItemProxy section */
21 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
22 | isa = PBXContainerItemProxy;
23 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
24 | proxyType = 1;
25 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
26 | remoteInfo = BasicApp;
27 | };
28 | /* End PBXContainerItemProxy section */
29 |
30 | /* Begin PBXFileReference section */
31 | 00E356EE1AD99517003FC87E /* BasicAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BasicAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
32 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
33 | 00E356F21AD99517003FC87E /* BasicAppTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BasicAppTests.m; sourceTree = ""; };
34 | 13B07F961A680F5B00A75B9A /* BasicApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BasicApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
35 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = BasicApp/AppDelegate.h; sourceTree = ""; };
36 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = BasicApp/AppDelegate.m; sourceTree = ""; };
37 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = BasicApp/Images.xcassets; sourceTree = ""; };
38 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = BasicApp/Info.plist; sourceTree = ""; };
39 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = BasicApp/main.m; sourceTree = ""; };
40 | 30B618F11CA9F61F4A2BCC18 /* Pods-BasicApp-BasicAppTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BasicApp-BasicAppTests.release.xcconfig"; path = "Target Support Files/Pods-BasicApp-BasicAppTests/Pods-BasicApp-BasicAppTests.release.xcconfig"; sourceTree = ""; };
41 | 3A03A3D0AA35DD00F816F6FD /* Pods-BasicApp-BasicAppTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BasicApp-BasicAppTests.debug.xcconfig"; path = "Target Support Files/Pods-BasicApp-BasicAppTests/Pods-BasicApp-BasicAppTests.debug.xcconfig"; sourceTree = ""; };
42 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = BasicApp/LaunchScreen.storyboard; sourceTree = ""; };
43 | A397D62B2A1AB4DE08565ACB /* Pods-BasicApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BasicApp.release.xcconfig"; path = "Target Support Files/Pods-BasicApp/Pods-BasicApp.release.xcconfig"; sourceTree = ""; };
44 | AA5E5B1A36C1EFD40B9FE59A /* libPods-BasicApp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BasicApp.a"; sourceTree = BUILT_PRODUCTS_DIR; };
45 | CF01C0912798908E009932D0 /* BasicApp-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BasicApp-Bridging-Header.h"; sourceTree = ""; };
46 | CF01C0922798908E009932D0 /* BridgeHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BridgeHeader.swift; sourceTree = ""; };
47 | D7DB328487C5F842F76563DF /* libPods-BasicApp-BasicAppTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BasicApp-BasicAppTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
48 | DBAE69E2F4FE155BDFBF583F /* Pods-BasicApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BasicApp.debug.xcconfig"; path = "Target Support Files/Pods-BasicApp/Pods-BasicApp.debug.xcconfig"; sourceTree = ""; };
49 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
50 | /* End PBXFileReference section */
51 |
52 | /* Begin PBXFrameworksBuildPhase section */
53 | 00E356EB1AD99517003FC87E /* Frameworks */ = {
54 | isa = PBXFrameworksBuildPhase;
55 | buildActionMask = 2147483647;
56 | files = (
57 | E1B8FFE0CC904B260DFE309F /* libPods-BasicApp-BasicAppTests.a in Frameworks */,
58 | );
59 | runOnlyForDeploymentPostprocessing = 0;
60 | };
61 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
62 | isa = PBXFrameworksBuildPhase;
63 | buildActionMask = 2147483647;
64 | files = (
65 | 2E2D5B56C32B148E16436AAD /* libPods-BasicApp.a in Frameworks */,
66 | );
67 | runOnlyForDeploymentPostprocessing = 0;
68 | };
69 | /* End PBXFrameworksBuildPhase section */
70 |
71 | /* Begin PBXGroup section */
72 | 00E356EF1AD99517003FC87E /* BasicAppTests */ = {
73 | isa = PBXGroup;
74 | children = (
75 | 00E356F21AD99517003FC87E /* BasicAppTests.m */,
76 | 00E356F01AD99517003FC87E /* Supporting Files */,
77 | );
78 | path = BasicAppTests;
79 | sourceTree = "";
80 | };
81 | 00E356F01AD99517003FC87E /* Supporting Files */ = {
82 | isa = PBXGroup;
83 | children = (
84 | 00E356F11AD99517003FC87E /* Info.plist */,
85 | );
86 | name = "Supporting Files";
87 | sourceTree = "";
88 | };
89 | 13B07FAE1A68108700A75B9A /* BasicApp */ = {
90 | isa = PBXGroup;
91 | children = (
92 | CF01C0922798908E009932D0 /* BridgeHeader.swift */,
93 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */,
94 | 13B07FB01A68108700A75B9A /* AppDelegate.m */,
95 | 13B07FB51A68108700A75B9A /* Images.xcassets */,
96 | 13B07FB61A68108700A75B9A /* Info.plist */,
97 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
98 | 13B07FB71A68108700A75B9A /* main.m */,
99 | CF01C0912798908E009932D0 /* BasicApp-Bridging-Header.h */,
100 | );
101 | name = BasicApp;
102 | sourceTree = "";
103 | };
104 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
105 | isa = PBXGroup;
106 | children = (
107 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
108 | AA5E5B1A36C1EFD40B9FE59A /* libPods-BasicApp.a */,
109 | D7DB328487C5F842F76563DF /* libPods-BasicApp-BasicAppTests.a */,
110 | );
111 | name = Frameworks;
112 | sourceTree = "";
113 | };
114 | 5CE79C194613E77BC4EA413A /* Pods */ = {
115 | isa = PBXGroup;
116 | children = (
117 | DBAE69E2F4FE155BDFBF583F /* Pods-BasicApp.debug.xcconfig */,
118 | A397D62B2A1AB4DE08565ACB /* Pods-BasicApp.release.xcconfig */,
119 | 3A03A3D0AA35DD00F816F6FD /* Pods-BasicApp-BasicAppTests.debug.xcconfig */,
120 | 30B618F11CA9F61F4A2BCC18 /* Pods-BasicApp-BasicAppTests.release.xcconfig */,
121 | );
122 | path = Pods;
123 | sourceTree = "";
124 | };
125 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = {
126 | isa = PBXGroup;
127 | children = (
128 | );
129 | name = Libraries;
130 | sourceTree = "";
131 | };
132 | 83CBB9F61A601CBA00E9B192 = {
133 | isa = PBXGroup;
134 | children = (
135 | 13B07FAE1A68108700A75B9A /* BasicApp */,
136 | 832341AE1AAA6A7D00B99B32 /* Libraries */,
137 | 00E356EF1AD99517003FC87E /* BasicAppTests */,
138 | 83CBBA001A601CBA00E9B192 /* Products */,
139 | 2D16E6871FA4F8E400B85C8A /* Frameworks */,
140 | 5CE79C194613E77BC4EA413A /* Pods */,
141 | );
142 | indentWidth = 2;
143 | sourceTree = "";
144 | tabWidth = 2;
145 | usesTabs = 0;
146 | };
147 | 83CBBA001A601CBA00E9B192 /* Products */ = {
148 | isa = PBXGroup;
149 | children = (
150 | 13B07F961A680F5B00A75B9A /* BasicApp.app */,
151 | 00E356EE1AD99517003FC87E /* BasicAppTests.xctest */,
152 | );
153 | name = Products;
154 | sourceTree = "";
155 | };
156 | /* End PBXGroup section */
157 |
158 | /* Begin PBXNativeTarget section */
159 | 00E356ED1AD99517003FC87E /* BasicAppTests */ = {
160 | isa = PBXNativeTarget;
161 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "BasicAppTests" */;
162 | buildPhases = (
163 | 8B7EE21C792A719595021F29 /* [CP] Check Pods Manifest.lock */,
164 | 00E356EA1AD99517003FC87E /* Sources */,
165 | 00E356EB1AD99517003FC87E /* Frameworks */,
166 | 00E356EC1AD99517003FC87E /* Resources */,
167 | 843EDEA405B56501C429ED84 /* [CP] Embed Pods Frameworks */,
168 | 84065F8AF2681FA8400F0F0C /* [CP] Copy Pods Resources */,
169 | );
170 | buildRules = (
171 | );
172 | dependencies = (
173 | 00E356F51AD99517003FC87E /* PBXTargetDependency */,
174 | );
175 | name = BasicAppTests;
176 | productName = BasicAppTests;
177 | productReference = 00E356EE1AD99517003FC87E /* BasicAppTests.xctest */;
178 | productType = "com.apple.product-type.bundle.unit-test";
179 | };
180 | 13B07F861A680F5B00A75B9A /* BasicApp */ = {
181 | isa = PBXNativeTarget;
182 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "BasicApp" */;
183 | buildPhases = (
184 | 9143125BD2F166E7D3FCEBD8 /* [CP] Check Pods Manifest.lock */,
185 | FD10A7F022414F080027D42C /* Start Packager */,
186 | 13B07F871A680F5B00A75B9A /* Sources */,
187 | 13B07F8C1A680F5B00A75B9A /* Frameworks */,
188 | 13B07F8E1A680F5B00A75B9A /* Resources */,
189 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
190 | 238C272505EC18894F147C47 /* [CP] Embed Pods Frameworks */,
191 | 2BC7CE56A6A153AA9DF05333 /* [CP] Copy Pods Resources */,
192 | );
193 | buildRules = (
194 | );
195 | dependencies = (
196 | );
197 | name = BasicApp;
198 | productName = BasicApp;
199 | productReference = 13B07F961A680F5B00A75B9A /* BasicApp.app */;
200 | productType = "com.apple.product-type.application";
201 | };
202 | /* End PBXNativeTarget section */
203 |
204 | /* Begin PBXProject section */
205 | 83CBB9F71A601CBA00E9B192 /* Project object */ = {
206 | isa = PBXProject;
207 | attributes = {
208 | LastUpgradeCheck = 1210;
209 | TargetAttributes = {
210 | 00E356ED1AD99517003FC87E = {
211 | CreatedOnToolsVersion = 6.2;
212 | TestTargetID = 13B07F861A680F5B00A75B9A;
213 | };
214 | 13B07F861A680F5B00A75B9A = {
215 | LastSwiftMigration = 1250;
216 | };
217 | };
218 | };
219 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "BasicApp" */;
220 | compatibilityVersion = "Xcode 12.0";
221 | developmentRegion = en;
222 | hasScannedForEncodings = 0;
223 | knownRegions = (
224 | en,
225 | Base,
226 | );
227 | mainGroup = 83CBB9F61A601CBA00E9B192;
228 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
229 | projectDirPath = "";
230 | projectRoot = "";
231 | targets = (
232 | 13B07F861A680F5B00A75B9A /* BasicApp */,
233 | 00E356ED1AD99517003FC87E /* BasicAppTests */,
234 | );
235 | };
236 | /* End PBXProject section */
237 |
238 | /* Begin PBXResourcesBuildPhase section */
239 | 00E356EC1AD99517003FC87E /* Resources */ = {
240 | isa = PBXResourcesBuildPhase;
241 | buildActionMask = 2147483647;
242 | files = (
243 | );
244 | runOnlyForDeploymentPostprocessing = 0;
245 | };
246 | 13B07F8E1A680F5B00A75B9A /* Resources */ = {
247 | isa = PBXResourcesBuildPhase;
248 | buildActionMask = 2147483647;
249 | files = (
250 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
251 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
252 | );
253 | runOnlyForDeploymentPostprocessing = 0;
254 | };
255 | /* End PBXResourcesBuildPhase section */
256 |
257 | /* Begin PBXShellScriptBuildPhase section */
258 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
259 | isa = PBXShellScriptBuildPhase;
260 | buildActionMask = 2147483647;
261 | files = (
262 | );
263 | inputPaths = (
264 | );
265 | name = "Bundle React Native code and images";
266 | outputPaths = (
267 | );
268 | runOnlyForDeploymentPostprocessing = 0;
269 | shellPath = /bin/sh;
270 | shellScript = "set -e\n\nexport NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
271 | };
272 | 238C272505EC18894F147C47 /* [CP] Embed Pods Frameworks */ = {
273 | isa = PBXShellScriptBuildPhase;
274 | buildActionMask = 2147483647;
275 | files = (
276 | );
277 | inputFileListPaths = (
278 | );
279 | name = "[CP] Embed Pods Frameworks";
280 | outputFileListPaths = (
281 | );
282 | runOnlyForDeploymentPostprocessing = 0;
283 | shellPath = /bin/sh;
284 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BasicApp/Pods-BasicApp-frameworks.sh\"\n";
285 | showEnvVarsInLog = 0;
286 | };
287 | 2BC7CE56A6A153AA9DF05333 /* [CP] Copy Pods Resources */ = {
288 | isa = PBXShellScriptBuildPhase;
289 | buildActionMask = 2147483647;
290 | files = (
291 | );
292 | inputFileListPaths = (
293 | );
294 | name = "[CP] Copy Pods Resources";
295 | outputFileListPaths = (
296 | );
297 | runOnlyForDeploymentPostprocessing = 0;
298 | shellPath = /bin/sh;
299 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BasicApp/Pods-BasicApp-resources.sh\"\n";
300 | showEnvVarsInLog = 0;
301 | };
302 | 84065F8AF2681FA8400F0F0C /* [CP] Copy Pods Resources */ = {
303 | isa = PBXShellScriptBuildPhase;
304 | buildActionMask = 2147483647;
305 | files = (
306 | );
307 | inputFileListPaths = (
308 | );
309 | name = "[CP] Copy Pods Resources";
310 | outputFileListPaths = (
311 | );
312 | runOnlyForDeploymentPostprocessing = 0;
313 | shellPath = /bin/sh;
314 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BasicApp-BasicAppTests/Pods-BasicApp-BasicAppTests-resources.sh\"\n";
315 | showEnvVarsInLog = 0;
316 | };
317 | 843EDEA405B56501C429ED84 /* [CP] Embed Pods Frameworks */ = {
318 | isa = PBXShellScriptBuildPhase;
319 | buildActionMask = 2147483647;
320 | files = (
321 | );
322 | inputFileListPaths = (
323 | );
324 | name = "[CP] Embed Pods Frameworks";
325 | outputFileListPaths = (
326 | );
327 | runOnlyForDeploymentPostprocessing = 0;
328 | shellPath = /bin/sh;
329 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BasicApp-BasicAppTests/Pods-BasicApp-BasicAppTests-frameworks.sh\"\n";
330 | showEnvVarsInLog = 0;
331 | };
332 | 8B7EE21C792A719595021F29 /* [CP] Check Pods Manifest.lock */ = {
333 | isa = PBXShellScriptBuildPhase;
334 | buildActionMask = 2147483647;
335 | files = (
336 | );
337 | inputFileListPaths = (
338 | );
339 | inputPaths = (
340 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
341 | "${PODS_ROOT}/Manifest.lock",
342 | );
343 | name = "[CP] Check Pods Manifest.lock";
344 | outputFileListPaths = (
345 | );
346 | outputPaths = (
347 | "$(DERIVED_FILE_DIR)/Pods-BasicApp-BasicAppTests-checkManifestLockResult.txt",
348 | );
349 | runOnlyForDeploymentPostprocessing = 0;
350 | shellPath = /bin/sh;
351 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
352 | showEnvVarsInLog = 0;
353 | };
354 | 9143125BD2F166E7D3FCEBD8 /* [CP] Check Pods Manifest.lock */ = {
355 | isa = PBXShellScriptBuildPhase;
356 | buildActionMask = 2147483647;
357 | files = (
358 | );
359 | inputFileListPaths = (
360 | );
361 | inputPaths = (
362 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
363 | "${PODS_ROOT}/Manifest.lock",
364 | );
365 | name = "[CP] Check Pods Manifest.lock";
366 | outputFileListPaths = (
367 | );
368 | outputPaths = (
369 | "$(DERIVED_FILE_DIR)/Pods-BasicApp-checkManifestLockResult.txt",
370 | );
371 | runOnlyForDeploymentPostprocessing = 0;
372 | shellPath = /bin/sh;
373 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
374 | showEnvVarsInLog = 0;
375 | };
376 | FD10A7F022414F080027D42C /* Start Packager */ = {
377 | isa = PBXShellScriptBuildPhase;
378 | buildActionMask = 2147483647;
379 | files = (
380 | );
381 | inputFileListPaths = (
382 | );
383 | inputPaths = (
384 | );
385 | name = "Start Packager";
386 | outputFileListPaths = (
387 | );
388 | outputPaths = (
389 | );
390 | runOnlyForDeploymentPostprocessing = 0;
391 | shellPath = /bin/sh;
392 | shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
393 | showEnvVarsInLog = 0;
394 | };
395 | /* End PBXShellScriptBuildPhase section */
396 |
397 | /* Begin PBXSourcesBuildPhase section */
398 | 00E356EA1AD99517003FC87E /* Sources */ = {
399 | isa = PBXSourcesBuildPhase;
400 | buildActionMask = 2147483647;
401 | files = (
402 | 00E356F31AD99517003FC87E /* BasicAppTests.m in Sources */,
403 | );
404 | runOnlyForDeploymentPostprocessing = 0;
405 | };
406 | 13B07F871A680F5B00A75B9A /* Sources */ = {
407 | isa = PBXSourcesBuildPhase;
408 | buildActionMask = 2147483647;
409 | files = (
410 | CF01C0932798908E009932D0 /* BridgeHeader.swift in Sources */,
411 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
412 | 13B07FC11A68108700A75B9A /* main.m in Sources */,
413 | );
414 | runOnlyForDeploymentPostprocessing = 0;
415 | };
416 | /* End PBXSourcesBuildPhase section */
417 |
418 | /* Begin PBXTargetDependency section */
419 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
420 | isa = PBXTargetDependency;
421 | target = 13B07F861A680F5B00A75B9A /* BasicApp */;
422 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
423 | };
424 | /* End PBXTargetDependency section */
425 |
426 | /* Begin XCBuildConfiguration section */
427 | 00E356F61AD99517003FC87E /* Debug */ = {
428 | isa = XCBuildConfiguration;
429 | baseConfigurationReference = 3A03A3D0AA35DD00F816F6FD /* Pods-BasicApp-BasicAppTests.debug.xcconfig */;
430 | buildSettings = {
431 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
432 | BUNDLE_LOADER = "$(TEST_HOST)";
433 | GCC_PREPROCESSOR_DEFINITIONS = (
434 | "DEBUG=1",
435 | "$(inherited)",
436 | );
437 | INFOPLIST_FILE = BasicAppTests/Info.plist;
438 | IPHONEOS_DEPLOYMENT_TARGET = 11.0;
439 | LD_RUNPATH_SEARCH_PATHS = (
440 | "$(inherited)",
441 | "@executable_path/Frameworks",
442 | "@loader_path/Frameworks",
443 | );
444 | OTHER_LDFLAGS = (
445 | "-ObjC",
446 | "-lc++",
447 | "$(inherited)",
448 | );
449 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
450 | PRODUCT_NAME = "$(TARGET_NAME)";
451 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/BasicApp.app/BasicApp";
452 | };
453 | name = Debug;
454 | };
455 | 00E356F71AD99517003FC87E /* Release */ = {
456 | isa = XCBuildConfiguration;
457 | baseConfigurationReference = 30B618F11CA9F61F4A2BCC18 /* Pods-BasicApp-BasicAppTests.release.xcconfig */;
458 | buildSettings = {
459 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
460 | BUNDLE_LOADER = "$(TEST_HOST)";
461 | COPY_PHASE_STRIP = NO;
462 | INFOPLIST_FILE = BasicAppTests/Info.plist;
463 | IPHONEOS_DEPLOYMENT_TARGET = 11.0;
464 | LD_RUNPATH_SEARCH_PATHS = (
465 | "$(inherited)",
466 | "@executable_path/Frameworks",
467 | "@loader_path/Frameworks",
468 | );
469 | OTHER_LDFLAGS = (
470 | "-ObjC",
471 | "-lc++",
472 | "$(inherited)",
473 | );
474 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
475 | PRODUCT_NAME = "$(TARGET_NAME)";
476 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/BasicApp.app/BasicApp";
477 | };
478 | name = Release;
479 | };
480 | 13B07F941A680F5B00A75B9A /* Debug */ = {
481 | isa = XCBuildConfiguration;
482 | baseConfigurationReference = DBAE69E2F4FE155BDFBF583F /* Pods-BasicApp.debug.xcconfig */;
483 | buildSettings = {
484 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
485 | CLANG_ENABLE_MODULES = YES;
486 | CURRENT_PROJECT_VERSION = 1;
487 | ENABLE_BITCODE = NO;
488 | INFOPLIST_FILE = BasicApp/Info.plist;
489 | LD_RUNPATH_SEARCH_PATHS = (
490 | "$(inherited)",
491 | "@executable_path/Frameworks",
492 | );
493 | OTHER_LDFLAGS = (
494 | "$(inherited)",
495 | "-ObjC",
496 | "-lc++",
497 | );
498 | PRESERVE_DEAD_CODE_INITS_AND_TERMS = NO;
499 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
500 | PRODUCT_NAME = BasicApp;
501 | SWIFT_OBJC_BRIDGING_HEADER = "BasicApp-Bridging-Header.h";
502 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
503 | SWIFT_VERSION = 5.0;
504 | VERSIONING_SYSTEM = "apple-generic";
505 | };
506 | name = Debug;
507 | };
508 | 13B07F951A680F5B00A75B9A /* Release */ = {
509 | isa = XCBuildConfiguration;
510 | baseConfigurationReference = A397D62B2A1AB4DE08565ACB /* Pods-BasicApp.release.xcconfig */;
511 | buildSettings = {
512 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
513 | CLANG_ENABLE_MODULES = YES;
514 | CURRENT_PROJECT_VERSION = 1;
515 | INFOPLIST_FILE = BasicApp/Info.plist;
516 | LD_RUNPATH_SEARCH_PATHS = (
517 | "$(inherited)",
518 | "@executable_path/Frameworks",
519 | );
520 | OTHER_LDFLAGS = (
521 | "$(inherited)",
522 | "-ObjC",
523 | "-lc++",
524 | );
525 | PRESERVE_DEAD_CODE_INITS_AND_TERMS = NO;
526 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
527 | PRODUCT_NAME = BasicApp;
528 | SWIFT_OBJC_BRIDGING_HEADER = "BasicApp-Bridging-Header.h";
529 | SWIFT_VERSION = 5.0;
530 | VERSIONING_SYSTEM = "apple-generic";
531 | };
532 | name = Release;
533 | };
534 | 83CBBA201A601CBA00E9B192 /* Debug */ = {
535 | isa = XCBuildConfiguration;
536 | buildSettings = {
537 | ALWAYS_SEARCH_USER_PATHS = NO;
538 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
539 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
540 | CLANG_CXX_LIBRARY = "libc++";
541 | CLANG_ENABLE_MODULES = YES;
542 | CLANG_ENABLE_OBJC_ARC = YES;
543 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
544 | CLANG_WARN_BOOL_CONVERSION = YES;
545 | CLANG_WARN_COMMA = YES;
546 | CLANG_WARN_CONSTANT_CONVERSION = YES;
547 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
548 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
549 | CLANG_WARN_EMPTY_BODY = YES;
550 | CLANG_WARN_ENUM_CONVERSION = YES;
551 | CLANG_WARN_INFINITE_RECURSION = YES;
552 | CLANG_WARN_INT_CONVERSION = YES;
553 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
554 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
555 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
556 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
557 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
558 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
559 | CLANG_WARN_STRICT_PROTOTYPES = YES;
560 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
561 | CLANG_WARN_UNREACHABLE_CODE = YES;
562 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
563 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
564 | COPY_PHASE_STRIP = NO;
565 | ENABLE_STRICT_OBJC_MSGSEND = YES;
566 | ENABLE_TESTABILITY = YES;
567 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
568 | GCC_C_LANGUAGE_STANDARD = gnu99;
569 | GCC_DYNAMIC_NO_PIC = NO;
570 | GCC_NO_COMMON_BLOCKS = YES;
571 | GCC_OPTIMIZATION_LEVEL = 0;
572 | GCC_PREPROCESSOR_DEFINITIONS = (
573 | "DEBUG=1",
574 | "$(inherited)",
575 | );
576 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
577 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
578 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
579 | GCC_WARN_UNDECLARED_SELECTOR = YES;
580 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
581 | GCC_WARN_UNUSED_FUNCTION = YES;
582 | GCC_WARN_UNUSED_VARIABLE = YES;
583 | IPHONEOS_DEPLOYMENT_TARGET = 11.0;
584 | LD_RUNPATH_SEARCH_PATHS = (
585 | /usr/lib/swift,
586 | "$(inherited)",
587 | );
588 | LIBRARY_SEARCH_PATHS = (
589 | "\"$(SDKROOT)/usr/lib/swift\"",
590 | "\"$(inherited)\"",
591 | );
592 | MTL_ENABLE_DEBUG_INFO = YES;
593 | ONLY_ACTIVE_ARCH = YES;
594 | PRESERVE_DEAD_CODE_INITS_AND_TERMS = YES;
595 | SDKROOT = iphoneos;
596 | };
597 | name = Debug;
598 | };
599 | 83CBBA211A601CBA00E9B192 /* Release */ = {
600 | isa = XCBuildConfiguration;
601 | buildSettings = {
602 | ALWAYS_SEARCH_USER_PATHS = NO;
603 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
604 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
605 | CLANG_CXX_LIBRARY = "libc++";
606 | CLANG_ENABLE_MODULES = YES;
607 | CLANG_ENABLE_OBJC_ARC = YES;
608 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
609 | CLANG_WARN_BOOL_CONVERSION = YES;
610 | CLANG_WARN_COMMA = YES;
611 | CLANG_WARN_CONSTANT_CONVERSION = YES;
612 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
613 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
614 | CLANG_WARN_EMPTY_BODY = YES;
615 | CLANG_WARN_ENUM_CONVERSION = YES;
616 | CLANG_WARN_INFINITE_RECURSION = YES;
617 | CLANG_WARN_INT_CONVERSION = YES;
618 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
619 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
620 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
621 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
622 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
623 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
624 | CLANG_WARN_STRICT_PROTOTYPES = YES;
625 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
626 | CLANG_WARN_UNREACHABLE_CODE = YES;
627 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
628 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
629 | COPY_PHASE_STRIP = YES;
630 | ENABLE_NS_ASSERTIONS = NO;
631 | ENABLE_STRICT_OBJC_MSGSEND = YES;
632 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
633 | GCC_C_LANGUAGE_STANDARD = gnu99;
634 | GCC_NO_COMMON_BLOCKS = YES;
635 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
636 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
637 | GCC_WARN_UNDECLARED_SELECTOR = YES;
638 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
639 | GCC_WARN_UNUSED_FUNCTION = YES;
640 | GCC_WARN_UNUSED_VARIABLE = YES;
641 | IPHONEOS_DEPLOYMENT_TARGET = 11.0;
642 | LD_RUNPATH_SEARCH_PATHS = (
643 | /usr/lib/swift,
644 | "$(inherited)",
645 | );
646 | LIBRARY_SEARCH_PATHS = (
647 | "\"$(SDKROOT)/usr/lib/swift\"",
648 | "\"$(inherited)\"",
649 | );
650 | MTL_ENABLE_DEBUG_INFO = NO;
651 | PRESERVE_DEAD_CODE_INITS_AND_TERMS = YES;
652 | SDKROOT = iphoneos;
653 | VALIDATE_PRODUCT = YES;
654 | };
655 | name = Release;
656 | };
657 | /* End XCBuildConfiguration section */
658 |
659 | /* Begin XCConfigurationList section */
660 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "BasicAppTests" */ = {
661 | isa = XCConfigurationList;
662 | buildConfigurations = (
663 | 00E356F61AD99517003FC87E /* Debug */,
664 | 00E356F71AD99517003FC87E /* Release */,
665 | );
666 | defaultConfigurationIsVisible = 0;
667 | defaultConfigurationName = Release;
668 | };
669 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "BasicApp" */ = {
670 | isa = XCConfigurationList;
671 | buildConfigurations = (
672 | 13B07F941A680F5B00A75B9A /* Debug */,
673 | 13B07F951A680F5B00A75B9A /* Release */,
674 | );
675 | defaultConfigurationIsVisible = 0;
676 | defaultConfigurationName = Release;
677 | };
678 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "BasicApp" */ = {
679 | isa = XCConfigurationList;
680 | buildConfigurations = (
681 | 83CBBA201A601CBA00E9B192 /* Debug */,
682 | 83CBBA211A601CBA00E9B192 /* Release */,
683 | );
684 | defaultConfigurationIsVisible = 0;
685 | defaultConfigurationName = Release;
686 | };
687 | /* End XCConfigurationList section */
688 | };
689 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
690 | }
691 |
--------------------------------------------------------------------------------
/example/ios/BasicApp.xcodeproj/xcshareddata/xcschemes/BasicApp.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
53 |
55 |
61 |
62 |
63 |
64 |
70 |
72 |
78 |
79 |
80 |
81 |
83 |
84 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/example/ios/BasicApp.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/example/ios/BasicApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/BasicApp/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : UIResponder
5 |
6 | @property (nonatomic, strong) UIWindow *window;
7 |
8 | @end
9 |
--------------------------------------------------------------------------------
/example/ios/BasicApp/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #import "AppDelegate.h"
2 |
3 | #import
4 | #import
5 | #import
6 |
7 | #ifdef FB_SONARKIT_ENABLED
8 | #import
9 | #import
10 | #import
11 | #import
12 | #import
13 | #import
14 |
15 | static void InitializeFlipper(UIApplication *application) {
16 | FlipperClient *client = [FlipperClient sharedClient];
17 | SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
18 | [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
19 | [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
20 | [client addPlugin:[FlipperKitReactPlugin new]];
21 | [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
22 | [client start];
23 | }
24 | #endif
25 |
26 | @implementation AppDelegate
27 |
28 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
29 | {
30 | #ifdef FB_SONARKIT_ENABLED
31 | InitializeFlipper(application);
32 | #endif
33 |
34 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
35 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
36 | moduleName:@"BasicApp"
37 | initialProperties:nil];
38 |
39 | if (@available(iOS 13.0, *)) {
40 | rootView.backgroundColor = [UIColor systemBackgroundColor];
41 | } else {
42 | rootView.backgroundColor = [UIColor whiteColor];
43 | }
44 |
45 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
46 | UIViewController *rootViewController = [UIViewController new];
47 | rootViewController.view = rootView;
48 | self.window.rootViewController = rootViewController;
49 | [self.window makeKeyAndVisible];
50 | return YES;
51 | }
52 |
53 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
54 | {
55 | #if DEBUG
56 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
57 | #else
58 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
59 | #endif
60 | }
61 |
62 | @end
63 |
--------------------------------------------------------------------------------
/example/ios/BasicApp/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/example/ios/BasicApp/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/example/ios/BasicApp/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | BasicApp
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSRequiresIPhoneOS
26 |
27 | NSAppTransportSecurity
28 |
29 | NSExceptionDomains
30 |
31 | localhost
32 |
33 | NSExceptionAllowsInsecureHTTPLoads
34 |
35 |
36 |
37 |
38 | NSLocationWhenInUseUsageDescription
39 |
40 | UIBackgroundModes
41 |
42 | audio
43 | fetch
44 | location
45 | processing
46 |
47 | UILaunchStoryboardName
48 | LaunchScreen
49 | UIRequiredDeviceCapabilities
50 |
51 | armv7
52 |
53 | UISupportedInterfaceOrientations
54 |
55 | UIInterfaceOrientationPortrait
56 | UIInterfaceOrientationLandscapeLeft
57 | UIInterfaceOrientationLandscapeRight
58 |
59 | UIViewControllerBasedStatusBarAppearance
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/example/ios/BasicApp/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
24 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/example/ios/BasicApp/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 |
--------------------------------------------------------------------------------
/example/ios/BasicAppTests/BasicAppTests.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | #import
5 | #import
6 |
7 | #define TIMEOUT_SECONDS 600
8 | #define TEXT_TO_LOOK_FOR @"Welcome to React"
9 |
10 | @interface BasicAppTests : XCTestCase
11 |
12 | @end
13 |
14 | @implementation BasicAppTests
15 |
16 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
17 | {
18 | if (test(view)) {
19 | return YES;
20 | }
21 | for (UIView *subview in [view subviews]) {
22 | if ([self findSubviewInView:subview matching:test]) {
23 | return YES;
24 | }
25 | }
26 | return NO;
27 | }
28 |
29 | - (void)testRendersWelcomeScreen
30 | {
31 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
32 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
33 | BOOL foundElement = NO;
34 |
35 | __block NSString *redboxError = nil;
36 | #ifdef DEBUG
37 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
38 | if (level >= RCTLogLevelError) {
39 | redboxError = message;
40 | }
41 | });
42 | #endif
43 |
44 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
45 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
46 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
47 |
48 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
49 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
50 | return YES;
51 | }
52 | return NO;
53 | }];
54 | }
55 |
56 | #ifdef DEBUG
57 | RCTSetLogFunction(RCTDefaultLogFunction);
58 | #endif
59 |
60 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
61 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
62 | }
63 |
64 |
65 | @end
66 |
--------------------------------------------------------------------------------
/example/ios/BasicAppTests/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 |
--------------------------------------------------------------------------------
/example/ios/BridgeHeader.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BridgeHeader.swift
3 | // BasicApp
4 | //
5 | // Created by Jorge Quevedo on 1/19/22.
6 | //
7 |
8 | import Foundation
9 |
--------------------------------------------------------------------------------
/example/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, '11.0'
5 | install! 'cocoapods', :disable_input_output_paths => true
6 |
7 | target 'BasicApp' do
8 | config = use_native_modules!
9 | pod 'react-native-mapbox-navigation', :path => '../../', :inhibit_warnings => false
10 | $ReactNativeMapboxGLIOSVersion = '~> 8.5.0'
11 |
12 | use_react_native!(
13 | :path => config[:reactNativePath],
14 | # to enable hermes on iOS, change `false` to `true` and then install pods
15 | :hermes_enabled => false
16 | )
17 |
18 | pre_install do |installer|
19 | $RNMBNAV.pre_install(installer)
20 | end
21 |
22 | target 'BasicAppTests' do
23 | inherit! :complete
24 | # Pods for testing
25 | end
26 |
27 | # Enables Flipper.
28 | #
29 | # Note that if you have use_frameworks! enabled, Flipper will not work and
30 | # you should disable the next line.
31 | # use_flipper!()
32 |
33 | post_install do |installer|
34 | react_native_post_install(installer)
35 | __apply_Xcode_12_5_M1_post_install_workaround(installer)
36 | installer.pods_project.targets.each do |t|
37 | t.build_configurations.each do |bc|
38 | bc.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
39 | end
40 | end
41 | # $RNMBNAV.post_install(installer)
42 | $RNMBNAV.pre_install(installer)
43 | end
44 | end
45 |
--------------------------------------------------------------------------------
/example/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - boost (1.76.0)
3 | - DoubleConversion (1.1.6)
4 | - FBLazyVector (0.66.4)
5 | - FBReactNativeSpec (0.66.4):
6 | - RCT-Folly (= 2021.06.28.00-v2)
7 | - RCTRequired (= 0.66.4)
8 | - RCTTypeSafety (= 0.66.4)
9 | - React-Core (= 0.66.4)
10 | - React-jsi (= 0.66.4)
11 | - ReactCommon/turbomodule/core (= 0.66.4)
12 | - fmt (6.2.1)
13 | - glog (0.3.5)
14 | - MapboxCommon (20.1.2)
15 | - MapboxCoreMaps (10.1.1):
16 | - MapboxCommon (~> 20.1)
17 | - MapboxCoreNavigation (2.1.1):
18 | - MapboxDirections (~> 2.1)
19 | - MapboxMobileEvents (~> 1.0)
20 | - MapboxNavigationNative (~> 80.0)
21 | - MapboxDirections (2.2.0):
22 | - Polyline (~> 5.0)
23 | - Turf (~> 2.0)
24 | - MapboxMaps (10.1.2):
25 | - MapboxCommon (= 20.1.2)
26 | - MapboxCoreMaps (= 10.1.1)
27 | - MapboxMobileEvents (= 1.0.6)
28 | - Turf (~> 2.0)
29 | - MapboxMobileEvents (1.0.6)
30 | - MapboxNavigation (2.1.1):
31 | - MapboxCoreNavigation (= 2.1.1)
32 | - MapboxMaps (< 11.0.0, >= 10.1.1)
33 | - MapboxMobileEvents (~> 1.0)
34 | - MapboxSpeech (~> 2.0)
35 | - Solar-dev (~> 3.0)
36 | - MapboxNavigationNative (80.0.2):
37 | - MapboxCommon (~> 20.1)
38 | - MapboxSpeech (2.0.0)
39 | - Polyline (5.0.2)
40 | - RCT-Folly (2021.06.28.00-v2):
41 | - boost
42 | - DoubleConversion
43 | - fmt (~> 6.2.1)
44 | - glog
45 | - RCT-Folly/Default (= 2021.06.28.00-v2)
46 | - RCT-Folly/Default (2021.06.28.00-v2):
47 | - boost
48 | - DoubleConversion
49 | - fmt (~> 6.2.1)
50 | - glog
51 | - RCTRequired (0.66.4)
52 | - RCTTypeSafety (0.66.4):
53 | - FBLazyVector (= 0.66.4)
54 | - RCT-Folly (= 2021.06.28.00-v2)
55 | - RCTRequired (= 0.66.4)
56 | - React-Core (= 0.66.4)
57 | - React (0.66.4):
58 | - React-Core (= 0.66.4)
59 | - React-Core/DevSupport (= 0.66.4)
60 | - React-Core/RCTWebSocket (= 0.66.4)
61 | - React-RCTActionSheet (= 0.66.4)
62 | - React-RCTAnimation (= 0.66.4)
63 | - React-RCTBlob (= 0.66.4)
64 | - React-RCTImage (= 0.66.4)
65 | - React-RCTLinking (= 0.66.4)
66 | - React-RCTNetwork (= 0.66.4)
67 | - React-RCTSettings (= 0.66.4)
68 | - React-RCTText (= 0.66.4)
69 | - React-RCTVibration (= 0.66.4)
70 | - React-callinvoker (0.66.4)
71 | - React-Core (0.66.4):
72 | - glog
73 | - RCT-Folly (= 2021.06.28.00-v2)
74 | - React-Core/Default (= 0.66.4)
75 | - React-cxxreact (= 0.66.4)
76 | - React-jsi (= 0.66.4)
77 | - React-jsiexecutor (= 0.66.4)
78 | - React-perflogger (= 0.66.4)
79 | - Yoga
80 | - React-Core/CoreModulesHeaders (0.66.4):
81 | - glog
82 | - RCT-Folly (= 2021.06.28.00-v2)
83 | - React-Core/Default
84 | - React-cxxreact (= 0.66.4)
85 | - React-jsi (= 0.66.4)
86 | - React-jsiexecutor (= 0.66.4)
87 | - React-perflogger (= 0.66.4)
88 | - Yoga
89 | - React-Core/Default (0.66.4):
90 | - glog
91 | - RCT-Folly (= 2021.06.28.00-v2)
92 | - React-cxxreact (= 0.66.4)
93 | - React-jsi (= 0.66.4)
94 | - React-jsiexecutor (= 0.66.4)
95 | - React-perflogger (= 0.66.4)
96 | - Yoga
97 | - React-Core/DevSupport (0.66.4):
98 | - glog
99 | - RCT-Folly (= 2021.06.28.00-v2)
100 | - React-Core/Default (= 0.66.4)
101 | - React-Core/RCTWebSocket (= 0.66.4)
102 | - React-cxxreact (= 0.66.4)
103 | - React-jsi (= 0.66.4)
104 | - React-jsiexecutor (= 0.66.4)
105 | - React-jsinspector (= 0.66.4)
106 | - React-perflogger (= 0.66.4)
107 | - Yoga
108 | - React-Core/RCTActionSheetHeaders (0.66.4):
109 | - glog
110 | - RCT-Folly (= 2021.06.28.00-v2)
111 | - React-Core/Default
112 | - React-cxxreact (= 0.66.4)
113 | - React-jsi (= 0.66.4)
114 | - React-jsiexecutor (= 0.66.4)
115 | - React-perflogger (= 0.66.4)
116 | - Yoga
117 | - React-Core/RCTAnimationHeaders (0.66.4):
118 | - glog
119 | - RCT-Folly (= 2021.06.28.00-v2)
120 | - React-Core/Default
121 | - React-cxxreact (= 0.66.4)
122 | - React-jsi (= 0.66.4)
123 | - React-jsiexecutor (= 0.66.4)
124 | - React-perflogger (= 0.66.4)
125 | - Yoga
126 | - React-Core/RCTBlobHeaders (0.66.4):
127 | - glog
128 | - RCT-Folly (= 2021.06.28.00-v2)
129 | - React-Core/Default
130 | - React-cxxreact (= 0.66.4)
131 | - React-jsi (= 0.66.4)
132 | - React-jsiexecutor (= 0.66.4)
133 | - React-perflogger (= 0.66.4)
134 | - Yoga
135 | - React-Core/RCTImageHeaders (0.66.4):
136 | - glog
137 | - RCT-Folly (= 2021.06.28.00-v2)
138 | - React-Core/Default
139 | - React-cxxreact (= 0.66.4)
140 | - React-jsi (= 0.66.4)
141 | - React-jsiexecutor (= 0.66.4)
142 | - React-perflogger (= 0.66.4)
143 | - Yoga
144 | - React-Core/RCTLinkingHeaders (0.66.4):
145 | - glog
146 | - RCT-Folly (= 2021.06.28.00-v2)
147 | - React-Core/Default
148 | - React-cxxreact (= 0.66.4)
149 | - React-jsi (= 0.66.4)
150 | - React-jsiexecutor (= 0.66.4)
151 | - React-perflogger (= 0.66.4)
152 | - Yoga
153 | - React-Core/RCTNetworkHeaders (0.66.4):
154 | - glog
155 | - RCT-Folly (= 2021.06.28.00-v2)
156 | - React-Core/Default
157 | - React-cxxreact (= 0.66.4)
158 | - React-jsi (= 0.66.4)
159 | - React-jsiexecutor (= 0.66.4)
160 | - React-perflogger (= 0.66.4)
161 | - Yoga
162 | - React-Core/RCTSettingsHeaders (0.66.4):
163 | - glog
164 | - RCT-Folly (= 2021.06.28.00-v2)
165 | - React-Core/Default
166 | - React-cxxreact (= 0.66.4)
167 | - React-jsi (= 0.66.4)
168 | - React-jsiexecutor (= 0.66.4)
169 | - React-perflogger (= 0.66.4)
170 | - Yoga
171 | - React-Core/RCTTextHeaders (0.66.4):
172 | - glog
173 | - RCT-Folly (= 2021.06.28.00-v2)
174 | - React-Core/Default
175 | - React-cxxreact (= 0.66.4)
176 | - React-jsi (= 0.66.4)
177 | - React-jsiexecutor (= 0.66.4)
178 | - React-perflogger (= 0.66.4)
179 | - Yoga
180 | - React-Core/RCTVibrationHeaders (0.66.4):
181 | - glog
182 | - RCT-Folly (= 2021.06.28.00-v2)
183 | - React-Core/Default
184 | - React-cxxreact (= 0.66.4)
185 | - React-jsi (= 0.66.4)
186 | - React-jsiexecutor (= 0.66.4)
187 | - React-perflogger (= 0.66.4)
188 | - Yoga
189 | - React-Core/RCTWebSocket (0.66.4):
190 | - glog
191 | - RCT-Folly (= 2021.06.28.00-v2)
192 | - React-Core/Default (= 0.66.4)
193 | - React-cxxreact (= 0.66.4)
194 | - React-jsi (= 0.66.4)
195 | - React-jsiexecutor (= 0.66.4)
196 | - React-perflogger (= 0.66.4)
197 | - Yoga
198 | - React-CoreModules (0.66.4):
199 | - FBReactNativeSpec (= 0.66.4)
200 | - RCT-Folly (= 2021.06.28.00-v2)
201 | - RCTTypeSafety (= 0.66.4)
202 | - React-Core/CoreModulesHeaders (= 0.66.4)
203 | - React-jsi (= 0.66.4)
204 | - React-RCTImage (= 0.66.4)
205 | - ReactCommon/turbomodule/core (= 0.66.4)
206 | - React-cxxreact (0.66.4):
207 | - boost (= 1.76.0)
208 | - DoubleConversion
209 | - glog
210 | - RCT-Folly (= 2021.06.28.00-v2)
211 | - React-callinvoker (= 0.66.4)
212 | - React-jsi (= 0.66.4)
213 | - React-jsinspector (= 0.66.4)
214 | - React-logger (= 0.66.4)
215 | - React-perflogger (= 0.66.4)
216 | - React-runtimeexecutor (= 0.66.4)
217 | - React-jsi (0.66.4):
218 | - boost (= 1.76.0)
219 | - DoubleConversion
220 | - glog
221 | - RCT-Folly (= 2021.06.28.00-v2)
222 | - React-jsi/Default (= 0.66.4)
223 | - React-jsi/Default (0.66.4):
224 | - boost (= 1.76.0)
225 | - DoubleConversion
226 | - glog
227 | - RCT-Folly (= 2021.06.28.00-v2)
228 | - React-jsiexecutor (0.66.4):
229 | - DoubleConversion
230 | - glog
231 | - RCT-Folly (= 2021.06.28.00-v2)
232 | - React-cxxreact (= 0.66.4)
233 | - React-jsi (= 0.66.4)
234 | - React-perflogger (= 0.66.4)
235 | - React-jsinspector (0.66.4)
236 | - React-logger (0.66.4):
237 | - glog
238 | - react-native-mapbox-navigation (1.1.0):
239 | - MapboxNavigation (~> 2.1.0)
240 | - React-Core
241 | - React-perflogger (0.66.4)
242 | - React-RCTActionSheet (0.66.4):
243 | - React-Core/RCTActionSheetHeaders (= 0.66.4)
244 | - React-RCTAnimation (0.66.4):
245 | - FBReactNativeSpec (= 0.66.4)
246 | - RCT-Folly (= 2021.06.28.00-v2)
247 | - RCTTypeSafety (= 0.66.4)
248 | - React-Core/RCTAnimationHeaders (= 0.66.4)
249 | - React-jsi (= 0.66.4)
250 | - ReactCommon/turbomodule/core (= 0.66.4)
251 | - React-RCTBlob (0.66.4):
252 | - FBReactNativeSpec (= 0.66.4)
253 | - RCT-Folly (= 2021.06.28.00-v2)
254 | - React-Core/RCTBlobHeaders (= 0.66.4)
255 | - React-Core/RCTWebSocket (= 0.66.4)
256 | - React-jsi (= 0.66.4)
257 | - React-RCTNetwork (= 0.66.4)
258 | - ReactCommon/turbomodule/core (= 0.66.4)
259 | - React-RCTImage (0.66.4):
260 | - FBReactNativeSpec (= 0.66.4)
261 | - RCT-Folly (= 2021.06.28.00-v2)
262 | - RCTTypeSafety (= 0.66.4)
263 | - React-Core/RCTImageHeaders (= 0.66.4)
264 | - React-jsi (= 0.66.4)
265 | - React-RCTNetwork (= 0.66.4)
266 | - ReactCommon/turbomodule/core (= 0.66.4)
267 | - React-RCTLinking (0.66.4):
268 | - FBReactNativeSpec (= 0.66.4)
269 | - React-Core/RCTLinkingHeaders (= 0.66.4)
270 | - React-jsi (= 0.66.4)
271 | - ReactCommon/turbomodule/core (= 0.66.4)
272 | - React-RCTNetwork (0.66.4):
273 | - FBReactNativeSpec (= 0.66.4)
274 | - RCT-Folly (= 2021.06.28.00-v2)
275 | - RCTTypeSafety (= 0.66.4)
276 | - React-Core/RCTNetworkHeaders (= 0.66.4)
277 | - React-jsi (= 0.66.4)
278 | - ReactCommon/turbomodule/core (= 0.66.4)
279 | - React-RCTSettings (0.66.4):
280 | - FBReactNativeSpec (= 0.66.4)
281 | - RCT-Folly (= 2021.06.28.00-v2)
282 | - RCTTypeSafety (= 0.66.4)
283 | - React-Core/RCTSettingsHeaders (= 0.66.4)
284 | - React-jsi (= 0.66.4)
285 | - ReactCommon/turbomodule/core (= 0.66.4)
286 | - React-RCTText (0.66.4):
287 | - React-Core/RCTTextHeaders (= 0.66.4)
288 | - React-RCTVibration (0.66.4):
289 | - FBReactNativeSpec (= 0.66.4)
290 | - RCT-Folly (= 2021.06.28.00-v2)
291 | - React-Core/RCTVibrationHeaders (= 0.66.4)
292 | - React-jsi (= 0.66.4)
293 | - ReactCommon/turbomodule/core (= 0.66.4)
294 | - React-runtimeexecutor (0.66.4):
295 | - React-jsi (= 0.66.4)
296 | - ReactCommon/turbomodule/core (0.66.4):
297 | - DoubleConversion
298 | - glog
299 | - RCT-Folly (= 2021.06.28.00-v2)
300 | - React-callinvoker (= 0.66.4)
301 | - React-Core (= 0.66.4)
302 | - React-cxxreact (= 0.66.4)
303 | - React-jsi (= 0.66.4)
304 | - React-logger (= 0.66.4)
305 | - React-perflogger (= 0.66.4)
306 | - Solar-dev (3.0.1)
307 | - Turf (2.2.0)
308 | - Yoga (1.14.0)
309 |
310 | DEPENDENCIES:
311 | - boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`)
312 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
313 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
314 | - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
315 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
316 | - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
317 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
318 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
319 | - React (from `../node_modules/react-native/`)
320 | - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`)
321 | - React-Core (from `../node_modules/react-native/`)
322 | - React-Core/DevSupport (from `../node_modules/react-native/`)
323 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`)
324 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`)
325 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
326 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
327 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
328 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
329 | - React-logger (from `../node_modules/react-native/ReactCommon/logger`)
330 | - react-native-mapbox-navigation (from `../../`)
331 | - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
332 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
333 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
334 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)
335 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`)
336 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`)
337 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`)
338 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`)
339 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`)
340 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
341 | - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`)
342 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
343 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
344 |
345 | SPEC REPOS:
346 | trunk:
347 | - fmt
348 | - MapboxCommon
349 | - MapboxCoreMaps
350 | - MapboxCoreNavigation
351 | - MapboxDirections
352 | - MapboxMaps
353 | - MapboxMobileEvents
354 | - MapboxNavigation
355 | - MapboxNavigationNative
356 | - MapboxSpeech
357 | - Polyline
358 | - Solar-dev
359 | - Turf
360 |
361 | EXTERNAL SOURCES:
362 | boost:
363 | :podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec"
364 | DoubleConversion:
365 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
366 | FBLazyVector:
367 | :path: "../node_modules/react-native/Libraries/FBLazyVector"
368 | FBReactNativeSpec:
369 | :path: "../node_modules/react-native/React/FBReactNativeSpec"
370 | glog:
371 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
372 | RCT-Folly:
373 | :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
374 | RCTRequired:
375 | :path: "../node_modules/react-native/Libraries/RCTRequired"
376 | RCTTypeSafety:
377 | :path: "../node_modules/react-native/Libraries/TypeSafety"
378 | React:
379 | :path: "../node_modules/react-native/"
380 | React-callinvoker:
381 | :path: "../node_modules/react-native/ReactCommon/callinvoker"
382 | React-Core:
383 | :path: "../node_modules/react-native/"
384 | React-CoreModules:
385 | :path: "../node_modules/react-native/React/CoreModules"
386 | React-cxxreact:
387 | :path: "../node_modules/react-native/ReactCommon/cxxreact"
388 | React-jsi:
389 | :path: "../node_modules/react-native/ReactCommon/jsi"
390 | React-jsiexecutor:
391 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor"
392 | React-jsinspector:
393 | :path: "../node_modules/react-native/ReactCommon/jsinspector"
394 | React-logger:
395 | :path: "../node_modules/react-native/ReactCommon/logger"
396 | react-native-mapbox-navigation:
397 | :path: "../../"
398 | React-perflogger:
399 | :path: "../node_modules/react-native/ReactCommon/reactperflogger"
400 | React-RCTActionSheet:
401 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS"
402 | React-RCTAnimation:
403 | :path: "../node_modules/react-native/Libraries/NativeAnimation"
404 | React-RCTBlob:
405 | :path: "../node_modules/react-native/Libraries/Blob"
406 | React-RCTImage:
407 | :path: "../node_modules/react-native/Libraries/Image"
408 | React-RCTLinking:
409 | :path: "../node_modules/react-native/Libraries/LinkingIOS"
410 | React-RCTNetwork:
411 | :path: "../node_modules/react-native/Libraries/Network"
412 | React-RCTSettings:
413 | :path: "../node_modules/react-native/Libraries/Settings"
414 | React-RCTText:
415 | :path: "../node_modules/react-native/Libraries/Text"
416 | React-RCTVibration:
417 | :path: "../node_modules/react-native/Libraries/Vibration"
418 | React-runtimeexecutor:
419 | :path: "../node_modules/react-native/ReactCommon/runtimeexecutor"
420 | ReactCommon:
421 | :path: "../node_modules/react-native/ReactCommon"
422 | Yoga:
423 | :path: "../node_modules/react-native/ReactCommon/yoga"
424 |
425 | SPEC CHECKSUMS:
426 | boost: a7c83b31436843459a1961bfd74b96033dc77234
427 | DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
428 | FBLazyVector: e5569e42a1c79ca00521846c223173a57aca1fe1
429 | FBReactNativeSpec: fe08c1cd7e2e205718d77ad14b34957cce949b58
430 | fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
431 | glog: 5337263514dd6f09803962437687240c5dc39aa4
432 | MapboxCommon: f15bb4cc4810d8d72e2d72bf2295f3f0cb328b11
433 | MapboxCoreMaps: ee3d7f31efbbafe81ce33907b6a96066e111a244
434 | MapboxCoreNavigation: 90cfee78d9a7aeada16468e6ad9cbf425c41acc3
435 | MapboxDirections: aaa6f1ae1612692ef3b4211d20d22404ad8ef607
436 | MapboxMaps: e4c4620a76b9e26a5d6cae10ffee5681a135b3de
437 | MapboxMobileEvents: 14d7ac3ee95b4142c4fec2205dfd48ff453e8871
438 | MapboxNavigation: ae52148971b92fd0b5735b15db7f5b1feb13906f
439 | MapboxNavigationNative: 5319134183246da72d3ad7f4d4089452ce450167
440 | MapboxSpeech: e4ed02984444b6373374c72c369edaf045cc490c
441 | Polyline: fce41d72e1146c41c6d081f7656827226f643dff
442 | RCT-Folly: a21c126816d8025b547704b777a2ba552f3d9fa9
443 | RCTRequired: 4bf86c70714490bca4bf2696148638284622644b
444 | RCTTypeSafety: c475a7059eb77935fa53d2c17db299893f057d5d
445 | React: f64af14e3f2c50f6f2c91a5fd250e4ff1b3c3459
446 | React-callinvoker: b74e4ae80287780dcdf0cab262bcb581eeef56e7
447 | React-Core: 3eb7432bad96ff1d25aebc1defbae013fee2fd0e
448 | React-CoreModules: ad9e1fd5650e16666c57a08328df86fd7e480cb9
449 | React-cxxreact: 02633ff398cf7e91a2c1e12590d323c4a4b8668a
450 | React-jsi: 805c41a927d6499fb811772acb971467d9204633
451 | React-jsiexecutor: 94ce921e1d8ce7023366873ec371f3441383b396
452 | React-jsinspector: d0374f7509d407d2264168b6d0fad0b54e300b85
453 | React-logger: 933f80c97c633ee8965d609876848148e3fef438
454 | react-native-mapbox-navigation: 0966e03abd15664a2255a40f315c91e109a8a054
455 | React-perflogger: 93075d8931c32cd1fce8a98c15d2d5ccc4d891bd
456 | React-RCTActionSheet: 7d3041e6761b4f3044a37079ddcb156575fb6d89
457 | React-RCTAnimation: 743e88b55ac62511ae5c2e22803d4f503f2a3a13
458 | React-RCTBlob: bee3a2f98fa7fc25c957c8643494244f74bea0a0
459 | React-RCTImage: 19fc9e29b06cc38611c553494f8d3040bf78c24e
460 | React-RCTLinking: dc799503979c8c711126d66328e7ce8f25c2848f
461 | React-RCTNetwork: 417e4e34cf3c19eaa5fd4e9eb20180d662a799ce
462 | React-RCTSettings: 4df89417265af26501a7e0e9192a34d3d9848dff
463 | React-RCTText: f8a21c3499ab322326290fa9b701ae29aa093aa5
464 | React-RCTVibration: e3ffca672dd3772536cb844274094b0e2c31b187
465 | React-runtimeexecutor: dec32ee6f2e2a26e13e58152271535fadff5455a
466 | ReactCommon: 57b69f6383eafcbd7da625bfa6003810332313c4
467 | Solar-dev: 4612dc9878b9fed2667d23b327f1d4e54e16e8d0
468 | Turf: 1a6bc2d0142f84610445159565c3c93d62b83897
469 | Yoga: e7dc4e71caba6472ff48ad7d234389b91dadc280
470 |
471 | PODFILE CHECKSUM: b825e0c0c2130ea0c4924baa443a786ab3686731
472 |
473 | COCOAPODS: 1.11.2
474 |
--------------------------------------------------------------------------------
/example/metro.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Metro configuration for React Native
3 | * https://github.com/facebook/react-native
4 | *
5 | * @format
6 | */
7 |
8 | const path = require('path');
9 | const blacklist = require('metro-config/src/defaults/exclusionList');
10 | const escape = require('escape-string-regexp');
11 | const pak = require('../package.json');
12 |
13 | const root = path.resolve(__dirname, '../');
14 |
15 | const modules = Object.keys({
16 | ...pak.peerDependencies,
17 | });
18 |
19 | module.exports = {
20 | projectRoot: __dirname,
21 | watchFolders: [root],
22 |
23 | // We need to make sure that only one version is loaded for peerDependencies
24 | // So we blacklist them at the root, and alias them to the versions in example's node_modules
25 | resolver: {
26 | blacklistRE: blacklist(
27 | modules.map(
28 | m => new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`),
29 | ),
30 | ),
31 |
32 | extraNodeModules: modules.reduce((acc, name) => {
33 | acc[name] = path.join(__dirname, 'node_modules', name);
34 | return acc;
35 | }, {}),
36 | },
37 | transformer: {
38 | getTransformOptions: async () => ({
39 | transform: {
40 | experimentalImportSupport: false,
41 | inlineRequires: true,
42 | },
43 | }),
44 | },
45 | };
46 |
--------------------------------------------------------------------------------
/example/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "basicapp",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "android": "react-native run-android",
7 | "ios": "react-native run-ios",
8 | "start": "react-native start",
9 | "test": "jest",
10 | "lint": "eslint ."
11 | },
12 | "dependencies": {
13 | "react": "17.0.2",
14 | "react-native": "0.66.4"
15 | },
16 | "devDependencies": {
17 | "@babel/core": "^7.12.9",
18 | "@babel/runtime": "^7.12.5",
19 | "@react-native-community/eslint-config": "^2.0.0",
20 | "babel-jest": "^26.6.3",
21 | "babel-plugin-module-resolver": "^4.1.0",
22 | "eslint": "7.14.0",
23 | "glob-to-regexp": "^0.4.1",
24 | "jest": "^26.6.3",
25 | "metro-react-native-babel-preset": "^0.66.2",
26 | "react-test-renderer": "17.0.2"
27 | },
28 | "jest": {
29 | "preset": "react-native"
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/img/bridging-header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/homeeondemand/react-native-mapbox-navigation/d0f729ce8665020145be7024c50bc3867e21001d/img/bridging-header.png
--------------------------------------------------------------------------------
/img/build-setting-linking.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/homeeondemand/react-native-mapbox-navigation/d0f729ce8665020145be7024c50bc3867e21001d/img/build-setting-linking.png
--------------------------------------------------------------------------------
/img/build-setting-path.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/homeeondemand/react-native-mapbox-navigation/d0f729ce8665020145be7024c50bc3867e21001d/img/build-setting-path.png
--------------------------------------------------------------------------------
/img/ios-nav.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/homeeondemand/react-native-mapbox-navigation/d0f729ce8665020145be7024c50bc3867e21001d/img/ios-nav.png
--------------------------------------------------------------------------------
/ios/MapboxNavigation-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "React/RCTBridgeModule.h"
2 | #import "React/RCTViewManager.h"
3 | #import "React/RCTEventEmitter.h"
4 |
--------------------------------------------------------------------------------
/ios/MapboxNavigation.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 957B881A244753D70058C6C1 /* MapboxNavigationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 957B8816244753D70058C6C1 /* MapboxNavigationView.swift */; };
11 | 957B881C244753D70058C6C1 /* MapboxNavigationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 957B8818244753D70058C6C1 /* MapboxNavigationManager.m */; };
12 | 957B881D244753D70058C6C1 /* MapboxNavigationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 957B8819244753D70058C6C1 /* MapboxNavigationManager.swift */; };
13 | /* End PBXBuildFile section */
14 |
15 | /* Begin PBXCopyFilesBuildPhase section */
16 | 58B511D91A9E6C8500147676 /* CopyFiles */ = {
17 | isa = PBXCopyFilesBuildPhase;
18 | buildActionMask = 2147483647;
19 | dstPath = "include/$(PRODUCT_NAME)";
20 | dstSubfolderSpec = 16;
21 | files = (
22 | );
23 | runOnlyForDeploymentPostprocessing = 0;
24 | };
25 | /* End PBXCopyFilesBuildPhase section */
26 |
27 | /* Begin PBXFileReference section */
28 | 134814201AA4EA6300B7C361 /* libMapboxNavigation.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMapboxNavigation.a; sourceTree = BUILT_PRODUCTS_DIR; };
29 | 957B8815244753D60058C6C1 /* MapboxNavigation-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MapboxNavigation-Bridging-Header.h"; sourceTree = ""; };
30 | 957B8816244753D70058C6C1 /* MapboxNavigationView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MapboxNavigationView.swift; sourceTree = ""; };
31 | 957B8818244753D70058C6C1 /* MapboxNavigationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MapboxNavigationManager.m; sourceTree = ""; };
32 | 957B8819244753D70058C6C1 /* MapboxNavigationManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MapboxNavigationManager.swift; sourceTree = ""; };
33 | /* End PBXFileReference section */
34 |
35 | /* Begin PBXFrameworksBuildPhase section */
36 | 58B511D81A9E6C8500147676 /* Frameworks */ = {
37 | isa = PBXFrameworksBuildPhase;
38 | buildActionMask = 2147483647;
39 | files = (
40 | );
41 | runOnlyForDeploymentPostprocessing = 0;
42 | };
43 | /* End PBXFrameworksBuildPhase section */
44 |
45 | /* Begin PBXGroup section */
46 | 134814211AA4EA7D00B7C361 /* Products */ = {
47 | isa = PBXGroup;
48 | children = (
49 | 134814201AA4EA6300B7C361 /* libMapboxNavigation.a */,
50 | );
51 | name = Products;
52 | sourceTree = "";
53 | };
54 | 58B511D21A9E6C8500147676 = {
55 | isa = PBXGroup;
56 | children = (
57 | 957B8818244753D70058C6C1 /* MapboxNavigationManager.m */,
58 | 957B8819244753D70058C6C1 /* MapboxNavigationManager.swift */,
59 | 957B8816244753D70058C6C1 /* MapboxNavigationView.swift */,
60 | 957B8815244753D60058C6C1 /* MapboxNavigation-Bridging-Header.h */,
61 | 134814211AA4EA7D00B7C361 /* Products */,
62 | );
63 | sourceTree = "";
64 | };
65 | /* End PBXGroup section */
66 |
67 | /* Begin PBXNativeTarget section */
68 | 58B511DA1A9E6C8500147676 /* MapboxNavigation */ = {
69 | isa = PBXNativeTarget;
70 | buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "MapboxNavigation" */;
71 | buildPhases = (
72 | 58B511D71A9E6C8500147676 /* Sources */,
73 | 58B511D81A9E6C8500147676 /* Frameworks */,
74 | 58B511D91A9E6C8500147676 /* CopyFiles */,
75 | );
76 | buildRules = (
77 | );
78 | dependencies = (
79 | );
80 | name = MapboxNavigation;
81 | productName = RCTDataManager;
82 | productReference = 134814201AA4EA6300B7C361 /* libMapboxNavigation.a */;
83 | productType = "com.apple.product-type.library.static";
84 | };
85 | /* End PBXNativeTarget section */
86 |
87 | /* Begin PBXProject section */
88 | 58B511D31A9E6C8500147676 /* Project object */ = {
89 | isa = PBXProject;
90 | attributes = {
91 | LastUpgradeCheck = 0920;
92 | ORGANIZATIONNAME = Facebook;
93 | TargetAttributes = {
94 | 58B511DA1A9E6C8500147676 = {
95 | CreatedOnToolsVersion = 6.1.1;
96 | LastSwiftMigration = 1140;
97 | };
98 | };
99 | };
100 | buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "MapboxNavigation" */;
101 | compatibilityVersion = "Xcode 3.2";
102 | developmentRegion = English;
103 | hasScannedForEncodings = 0;
104 | knownRegions = (
105 | English,
106 | en,
107 | );
108 | mainGroup = 58B511D21A9E6C8500147676;
109 | productRefGroup = 58B511D21A9E6C8500147676;
110 | projectDirPath = "";
111 | projectRoot = "";
112 | targets = (
113 | 58B511DA1A9E6C8500147676 /* MapboxNavigation */,
114 | );
115 | };
116 | /* End PBXProject section */
117 |
118 | /* Begin PBXSourcesBuildPhase section */
119 | 58B511D71A9E6C8500147676 /* Sources */ = {
120 | isa = PBXSourcesBuildPhase;
121 | buildActionMask = 2147483647;
122 | files = (
123 | 957B881C244753D70058C6C1 /* MapboxNavigationManager.m in Sources */,
124 | 957B881D244753D70058C6C1 /* MapboxNavigationManager.swift in Sources */,
125 | 957B881A244753D70058C6C1 /* MapboxNavigationView.swift in Sources */,
126 | );
127 | runOnlyForDeploymentPostprocessing = 0;
128 | };
129 | /* End PBXSourcesBuildPhase section */
130 |
131 | /* Begin XCBuildConfiguration section */
132 | 58B511ED1A9E6C8500147676 /* Debug */ = {
133 | isa = XCBuildConfiguration;
134 | buildSettings = {
135 | ALWAYS_SEARCH_USER_PATHS = NO;
136 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
137 | CLANG_CXX_LIBRARY = "libc++";
138 | CLANG_ENABLE_MODULES = YES;
139 | CLANG_ENABLE_OBJC_ARC = YES;
140 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
141 | CLANG_WARN_BOOL_CONVERSION = YES;
142 | CLANG_WARN_COMMA = YES;
143 | CLANG_WARN_CONSTANT_CONVERSION = YES;
144 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
145 | CLANG_WARN_EMPTY_BODY = YES;
146 | CLANG_WARN_ENUM_CONVERSION = YES;
147 | CLANG_WARN_INFINITE_RECURSION = YES;
148 | CLANG_WARN_INT_CONVERSION = YES;
149 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
150 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
151 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
152 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
153 | CLANG_WARN_STRICT_PROTOTYPES = YES;
154 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
155 | CLANG_WARN_UNREACHABLE_CODE = YES;
156 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
157 | COPY_PHASE_STRIP = NO;
158 | ENABLE_STRICT_OBJC_MSGSEND = YES;
159 | ENABLE_TESTABILITY = YES;
160 | GCC_C_LANGUAGE_STANDARD = gnu99;
161 | GCC_DYNAMIC_NO_PIC = NO;
162 | GCC_NO_COMMON_BLOCKS = YES;
163 | GCC_OPTIMIZATION_LEVEL = 0;
164 | GCC_PREPROCESSOR_DEFINITIONS = (
165 | "DEBUG=1",
166 | "$(inherited)",
167 | );
168 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
169 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
170 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
171 | GCC_WARN_UNDECLARED_SELECTOR = YES;
172 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
173 | GCC_WARN_UNUSED_FUNCTION = YES;
174 | GCC_WARN_UNUSED_VARIABLE = YES;
175 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
176 | MTL_ENABLE_DEBUG_INFO = YES;
177 | ONLY_ACTIVE_ARCH = YES;
178 | SDKROOT = iphoneos;
179 | };
180 | name = Debug;
181 | };
182 | 58B511EE1A9E6C8500147676 /* Release */ = {
183 | isa = XCBuildConfiguration;
184 | buildSettings = {
185 | ALWAYS_SEARCH_USER_PATHS = NO;
186 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
187 | CLANG_CXX_LIBRARY = "libc++";
188 | CLANG_ENABLE_MODULES = YES;
189 | CLANG_ENABLE_OBJC_ARC = YES;
190 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
191 | CLANG_WARN_BOOL_CONVERSION = YES;
192 | CLANG_WARN_COMMA = YES;
193 | CLANG_WARN_CONSTANT_CONVERSION = YES;
194 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
195 | CLANG_WARN_EMPTY_BODY = YES;
196 | CLANG_WARN_ENUM_CONVERSION = YES;
197 | CLANG_WARN_INFINITE_RECURSION = YES;
198 | CLANG_WARN_INT_CONVERSION = YES;
199 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
200 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
201 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
202 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
203 | CLANG_WARN_STRICT_PROTOTYPES = YES;
204 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
205 | CLANG_WARN_UNREACHABLE_CODE = YES;
206 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
207 | COPY_PHASE_STRIP = YES;
208 | ENABLE_NS_ASSERTIONS = NO;
209 | ENABLE_STRICT_OBJC_MSGSEND = YES;
210 | GCC_C_LANGUAGE_STANDARD = gnu99;
211 | GCC_NO_COMMON_BLOCKS = YES;
212 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
213 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
214 | GCC_WARN_UNDECLARED_SELECTOR = YES;
215 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
216 | GCC_WARN_UNUSED_FUNCTION = YES;
217 | GCC_WARN_UNUSED_VARIABLE = YES;
218 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
219 | MTL_ENABLE_DEBUG_INFO = NO;
220 | SDKROOT = iphoneos;
221 | VALIDATE_PRODUCT = YES;
222 | };
223 | name = Release;
224 | };
225 | 58B511F01A9E6C8500147676 /* Debug */ = {
226 | isa = XCBuildConfiguration;
227 | buildSettings = {
228 | CLANG_ENABLE_MODULES = YES;
229 | HEADER_SEARCH_PATHS = (
230 | "$(inherited)",
231 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
232 | "$(SRCROOT)/../../../React/**",
233 | "$(SRCROOT)/../../react-native/React/**",
234 | );
235 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
236 | LIBRARY_SEARCH_PATHS = "$(inherited)";
237 | OTHER_LDFLAGS = "-ObjC";
238 | PRODUCT_NAME = MapboxNavigation;
239 | SKIP_INSTALL = YES;
240 | SWIFT_OBJC_BRIDGING_HEADER = "MapboxNavigation-Bridging-Header.h";
241 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
242 | SWIFT_VERSION = 5.0;
243 | };
244 | name = Debug;
245 | };
246 | 58B511F11A9E6C8500147676 /* Release */ = {
247 | isa = XCBuildConfiguration;
248 | buildSettings = {
249 | CLANG_ENABLE_MODULES = YES;
250 | HEADER_SEARCH_PATHS = (
251 | "$(inherited)",
252 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
253 | "$(SRCROOT)/../../../React/**",
254 | "$(SRCROOT)/../../react-native/React/**",
255 | );
256 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
257 | LIBRARY_SEARCH_PATHS = "$(inherited)";
258 | OTHER_LDFLAGS = "-ObjC";
259 | PRODUCT_NAME = MapboxNavigation;
260 | SKIP_INSTALL = YES;
261 | SWIFT_OBJC_BRIDGING_HEADER = "MapboxNavigation-Bridging-Header.h";
262 | SWIFT_VERSION = 5.0;
263 | };
264 | name = Release;
265 | };
266 | /* End XCBuildConfiguration section */
267 |
268 | /* Begin XCConfigurationList section */
269 | 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "MapboxNavigation" */ = {
270 | isa = XCConfigurationList;
271 | buildConfigurations = (
272 | 58B511ED1A9E6C8500147676 /* Debug */,
273 | 58B511EE1A9E6C8500147676 /* Release */,
274 | );
275 | defaultConfigurationIsVisible = 0;
276 | defaultConfigurationName = Release;
277 | };
278 | 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "MapboxNavigation" */ = {
279 | isa = XCConfigurationList;
280 | buildConfigurations = (
281 | 58B511F01A9E6C8500147676 /* Debug */,
282 | 58B511F11A9E6C8500147676 /* Release */,
283 | );
284 | defaultConfigurationIsVisible = 0;
285 | defaultConfigurationName = Release;
286 | };
287 | /* End XCConfigurationList section */
288 | };
289 | rootObject = 58B511D31A9E6C8500147676 /* Project object */;
290 | }
291 |
--------------------------------------------------------------------------------
/ios/MapboxNavigation.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/MapboxNavigation.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/MapboxNavigationManager.m:
--------------------------------------------------------------------------------
1 | #import "React/RCTViewManager.h"
2 |
3 | @interface RCT_EXTERN_MODULE(MapboxNavigationManager, RCTViewManager)
4 |
5 | RCT_EXPORT_VIEW_PROPERTY(onLocationChange, RCTDirectEventBlock)
6 | RCT_EXPORT_VIEW_PROPERTY(onRouteProgressChange, RCTDirectEventBlock)
7 | RCT_EXPORT_VIEW_PROPERTY(onError, RCTDirectEventBlock)
8 | RCT_EXPORT_VIEW_PROPERTY(onCancelNavigation, RCTDirectEventBlock)
9 | RCT_EXPORT_VIEW_PROPERTY(onArrive, RCTDirectEventBlock)
10 | RCT_EXPORT_VIEW_PROPERTY(origin, NSArray)
11 | RCT_EXPORT_VIEW_PROPERTY(destination, NSArray)
12 | RCT_EXPORT_VIEW_PROPERTY(shouldSimulateRoute, BOOL)
13 | RCT_EXPORT_VIEW_PROPERTY(showsEndOfRouteFeedback, BOOL)
14 | RCT_EXPORT_VIEW_PROPERTY(hideStatusView, BOOL)
15 | RCT_EXPORT_VIEW_PROPERTY(mute, BOOL)
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/ios/MapboxNavigationManager.swift:
--------------------------------------------------------------------------------
1 | @objc(MapboxNavigationManager)
2 | class MapboxNavigationManager: RCTViewManager {
3 | override func view() -> UIView! {
4 | return MapboxNavigationView();
5 | }
6 |
7 | override static func requiresMainQueueSetup() -> Bool {
8 | return true
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/ios/MapboxNavigationView.swift:
--------------------------------------------------------------------------------
1 | import MapboxCoreNavigation
2 | import MapboxNavigation
3 | import MapboxDirections
4 |
5 | // // adapted from https://pspdfkit.com/blog/2017/native-view-controllers-and-react-native/ and https://github.com/mslabenyak/react-native-mapbox-navigation/blob/master/ios/Mapbox/MapboxNavigationView.swift
6 | extension UIView {
7 | var parentViewController: UIViewController? {
8 | var parentResponder: UIResponder? = self
9 | while parentResponder != nil {
10 | parentResponder = parentResponder!.next
11 | if let viewController = parentResponder as? UIViewController {
12 | return viewController
13 | }
14 | }
15 | return nil
16 | }
17 | }
18 |
19 | class MapboxNavigationView: UIView, NavigationViewControllerDelegate {
20 | weak var navViewController: NavigationViewController?
21 | var embedded: Bool
22 | var embedding: Bool
23 |
24 | @objc var origin: NSArray = [] {
25 | didSet { setNeedsLayout() }
26 | }
27 |
28 | @objc var destination: NSArray = [] {
29 | didSet { setNeedsLayout() }
30 | }
31 |
32 | @objc var shouldSimulateRoute: Bool = false
33 | @objc var showsEndOfRouteFeedback: Bool = false
34 | @objc var hideStatusView: Bool = false
35 | @objc var mute: Bool = false
36 |
37 | @objc var onLocationChange: RCTDirectEventBlock?
38 | @objc var onRouteProgressChange: RCTDirectEventBlock?
39 | @objc var onError: RCTDirectEventBlock?
40 | @objc var onCancelNavigation: RCTDirectEventBlock?
41 | @objc var onArrive: RCTDirectEventBlock?
42 |
43 | override init(frame: CGRect) {
44 | self.embedded = false
45 | self.embedding = false
46 | super.init(frame: frame)
47 | }
48 |
49 | required init?(coder aDecoder: NSCoder) {
50 | fatalError("init(coder:) has not been implemented")
51 | }
52 |
53 | override func layoutSubviews() {
54 | super.layoutSubviews()
55 |
56 | if (navViewController == nil && !embedding && !embedded) {
57 | embed()
58 | } else {
59 | navViewController?.view.frame = bounds
60 | }
61 | }
62 |
63 | override func removeFromSuperview() {
64 | super.removeFromSuperview()
65 | // cleanup and teardown any existing resources
66 | self.navViewController?.removeFromParent()
67 | }
68 |
69 | private func embed() {
70 | guard origin.count == 2 && destination.count == 2 else { return }
71 |
72 | embedding = true
73 |
74 | let originWaypoint = Waypoint(coordinate: CLLocationCoordinate2D(latitude: origin[1] as! CLLocationDegrees, longitude: origin[0] as! CLLocationDegrees))
75 | let destinationWaypoint = Waypoint(coordinate: CLLocationCoordinate2D(latitude: destination[1] as! CLLocationDegrees, longitude: destination[0] as! CLLocationDegrees))
76 |
77 | // let options = NavigationRouteOptions(waypoints: [originWaypoint, destinationWaypoint])
78 | let options = NavigationRouteOptions(waypoints: [originWaypoint, destinationWaypoint], profileIdentifier: .automobileAvoidingTraffic)
79 |
80 | Directions.shared.calculate(options) { [weak self] (_, result) in
81 | guard let strongSelf = self, let parentVC = strongSelf.parentViewController else {
82 | return
83 | }
84 |
85 | switch result {
86 | case .failure(let error):
87 | strongSelf.onError!(["message": error.localizedDescription])
88 | case .success(let response):
89 | guard let weakSelf = self else {
90 | return
91 | }
92 |
93 | let navigationService = MapboxNavigationService(routeResponse: response, routeIndex: 0, routeOptions: options, simulating: strongSelf.shouldSimulateRoute ? .always : .never)
94 |
95 | let navigationOptions = NavigationOptions(navigationService: navigationService)
96 | let vc = NavigationViewController(for: response, routeIndex: 0, routeOptions: options, navigationOptions: navigationOptions)
97 |
98 | vc.showsEndOfRouteFeedback = strongSelf.showsEndOfRouteFeedback
99 | StatusView.appearance().isHidden = strongSelf.hideStatusView
100 |
101 | NavigationSettings.shared.voiceMuted = strongSelf.mute;
102 |
103 | vc.delegate = strongSelf
104 |
105 | parentVC.addChild(vc)
106 | strongSelf.addSubview(vc.view)
107 | vc.view.frame = strongSelf.bounds
108 | vc.didMove(toParent: parentVC)
109 | strongSelf.navViewController = vc
110 | }
111 |
112 | strongSelf.embedding = false
113 | strongSelf.embedded = true
114 | }
115 | }
116 |
117 | func navigationViewController(_ navigationViewController: NavigationViewController, didUpdate progress: RouteProgress, with location: CLLocation, rawLocation: CLLocation) {
118 | onLocationChange?(["longitude": location.coordinate.longitude, "latitude": location.coordinate.latitude])
119 | onRouteProgressChange?(["distanceTraveled": progress.distanceTraveled,
120 | "durationRemaining": progress.durationRemaining,
121 | "fractionTraveled": progress.fractionTraveled,
122 | "distanceRemaining": progress.distanceRemaining])
123 | }
124 |
125 | func navigationViewControllerDidDismiss(_ navigationViewController: NavigationViewController, byCanceling canceled: Bool) {
126 | if (!canceled) {
127 | return;
128 | }
129 | onCancelNavigation?(["message": ""]);
130 | }
131 |
132 | func navigationViewController(_ navigationViewController: NavigationViewController, didArriveAt waypoint: Waypoint) -> Bool {
133 | onArrive?(["message": ""]);
134 | return true;
135 | }
136 | }
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@homee/react-native-mapbox-navigation",
3 | "title": "React Native Mapbox Navigation",
4 | "version": "2.0.1",
5 | "description": "Smart Mapbox turn-by-turn routing based on real-time traffic for React Native.",
6 | "main": "dist/index.js",
7 | "types": "dist/index.d.ts",
8 | "source": "src/index",
9 | "scripts": {
10 | "prepublishOnly": "tsc",
11 | "test": "echo \"Error: no test specified\" && exit 1"
12 | },
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/homeeondemand/react-native-mapbox-navigation.git",
16 | "baseUrl": "https://github.com/homeeondemand/react-native-mapbox-navigation.git"
17 | },
18 | "keywords": [
19 | "react-native",
20 | "mapbox",
21 | "navigation"
22 | ],
23 | "license": "MIT",
24 | "licenseFilename": "LICENSE",
25 | "readmeFilename": "README.md",
26 | "bugs": {
27 | "url": "https://github.com/homeeondemand/react-native-mapbox-navigation/issues"
28 | },
29 | "homepage": "https://github.com/homeeondemand/react-native-mapbox-navigation#readme",
30 | "peerDependencies": {
31 | "react": "*",
32 | "react-native": "*"
33 | },
34 | "devDependencies": {
35 | "react": "17.0.2",
36 | "react-native": "0.66.4",
37 | "typescript": "4.3.5"
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/react-native-mapbox-navigation.podspec:
--------------------------------------------------------------------------------
1 | require "json"
2 |
3 | package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4 |
5 | # TargetsToChangeToDynamic = ['MapboxMobileEvents']
6 | TargetsToChangeToDynamic = []
7 |
8 | $RNMBNAV = Object.new
9 |
10 | def $RNMBNAV.post_install(installer)
11 | installer.pod_targets.each do |pod|
12 | if TargetsToChangeToDynamic.include?(pod.name)
13 | if pod.send(:build_type) != Pod::BuildType.dynamic_framework
14 | pod.instance_variable_set(:@build_type,Pod::BuildType.dynamic_framework)
15 | puts "* Changed #{pod.name} to `#{pod.send(:build_type)}`"
16 | fail "Unable to change build_type" unless mobile_events_target.send(:build_type) == Pod::BuildType.dynamic_framework
17 | end
18 | end
19 | end
20 | end
21 |
22 | def $RNMBNAV.pre_install(installer)
23 | installer.aggregate_targets.each do |target|
24 | target.pod_targets.select { |p| TargetsToChangeToDynamic.include?(p.name) }.each do |mobile_events_target|
25 | mobile_events_target.instance_variable_set(:@build_type,Pod::BuildType.dynamic_framework)
26 | puts "* Changed #{mobile_events_target.name} to #{mobile_events_target.send(:build_type)}"
27 | fail "Unable to change build_type" unless mobile_events_target.send(:build_type) == Pod::BuildType.dynamic_framework
28 | end
29 | end
30 | end
31 |
32 | Pod::Spec.new do |s|
33 | s.name = "react-native-mapbox-navigation"
34 | s.version = package["version"]
35 | s.summary = package["description"]
36 | s.description = <<-DESC
37 | Smart Mapbox turn-by-turn routing based on real-time traffic for React Native.
38 | DESC
39 | s.homepage = "https://github.com/homeeondemand/react-native-mapbox-navigation"
40 | s.license = { :type => "MIT", :file => "LICENSE" }
41 | s.authors = { "HOMEE" => "support@homee.com" }
42 | s.platforms = { :ios => "11.0" }
43 | s.source = { :git => "https://github.com/homeeondemand/react-native-mapbox-navigation.git", :tag => "#{s.version}" }
44 |
45 | s.source_files = "ios/**/*.{h,m,swift}"
46 | s.requires_arc = true
47 |
48 | s.dependency "React-Core"
49 | s.dependency "MapboxNavigation", "~> 2.1.1"
50 | end
51 |
52 |
--------------------------------------------------------------------------------
/src/index.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { requireNativeComponent, StyleSheet } from 'react-native';
3 |
4 | import { IMapboxNavigationProps } from './typings';
5 |
6 | const MapboxNavigation = (props: IMapboxNavigationProps) => {
7 | return ;
8 | };
9 |
10 | const RNMapboxNavigation = requireNativeComponent(
11 | 'MapboxNavigation',
12 | MapboxNavigation
13 | );
14 |
15 | const styles = StyleSheet.create({
16 | container: {
17 | flex: 1,
18 | },
19 | });
20 |
21 | export default MapboxNavigation;
22 |
--------------------------------------------------------------------------------
/src/typings.ts:
--------------------------------------------------------------------------------
1 | /** @type {[number, number]}
2 | * Provide an array with longitude and latitude [$longitude, $latitude]
3 | */
4 | type Coordinate = [number, number];
5 |
6 | type OnLocationChangeEvent = {
7 | nativeEvent?: {
8 | latitude: number;
9 | longitude: number;
10 | };
11 | };
12 |
13 | type OnRouteProgressChangeEvent = {
14 | nativeEvent?: {
15 | distanceTraveled: number;
16 | durationRemaining: number;
17 | fractionTraveled: number;
18 | distanceRemaining: number;
19 | };
20 | };
21 |
22 | type OnErrorEvent = {
23 | nativeEvent?: {
24 | message?: string;
25 | };
26 | };
27 |
28 | export interface IMapboxNavigationProps {
29 | origin: Coordinate;
30 | destination: Coordinate;
31 | shouldSimulateRoute?: boolean;
32 | onLocationChange?: (event: OnLocationChangeEvent) => void;
33 | onRouteProgressChange?: (event: OnRouteProgressChangeEvent) => void;
34 | onError?: (event: OnErrorEvent) => void;
35 | onCancelNavigation?: () => void;
36 | onArrive?: () => void;
37 | showsEndOfRouteFeedback?: boolean;
38 | hideStatusView?: boolean;
39 | mute?: boolean;
40 | }
41 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es6",
4 | "module": "es6",
5 | "declaration": true,
6 | "outDir": "./dist",
7 | "strict": false,
8 | "jsx": "react-native",
9 | "skipLibCheck": true,
10 | "moduleResolution": "node"
11 | },
12 | "include": ["src"],
13 | "exclude": ["node_modules", "**/__tests__/*", "example"]
14 | }
15 |
--------------------------------------------------------------------------------