Skip to content

Commit 1e7c114

Browse files
authored
feat!: upgrade @googlemaps/react-native-navigation-sdk to v0.12.0 (#71)
* chore: upgrade dependencies to match the @googlemaps/react-native-navigation-sdk library * feat: upgrade @googlemaps/react-native-navigation-sdk dependency version to ^0.12.0 BREAKING CHANGE: iOS header_dir changed to ReactNativeGoogleMapsDriver BREAKING CHANGE: See navigation SDK v0.12.0 release notes: https://github.com/googlemaps/react-native-navigation-sdk/releases/tag/v0.12.0
1 parent be5b6f1 commit 1e7c114

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+4007
-3290
lines changed

.eslintrc.js

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
/**
2+
* Copyright 2025 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
module.exports = {
18+
root: true,
19+
parser: '@typescript-eslint/parser',
20+
parserOptions: {
21+
ecmaVersion: 'latest',
22+
sourceType: 'module',
23+
ecmaFeatures: {
24+
jsx: true,
25+
},
26+
},
27+
env: {
28+
'es2021': true,
29+
'node': true,
30+
'react-native/react-native': true,
31+
},
32+
plugins: [
33+
'@typescript-eslint',
34+
'react',
35+
'react-hooks',
36+
'react-native',
37+
'import',
38+
'prettier',
39+
],
40+
extends: [
41+
'eslint:recommended',
42+
'plugin:@typescript-eslint/recommended',
43+
'plugin:react/recommended',
44+
'plugin:react-hooks/recommended',
45+
'plugin:react-native/all',
46+
'plugin:import/errors',
47+
'plugin:import/warnings',
48+
'plugin:import/typescript',
49+
'plugin:prettier/recommended',
50+
],
51+
rules: {
52+
'prettier/prettier': 'warn',
53+
'react/react-in-jsx-scope': 'off',
54+
'react-native/no-inline-styles': 'off',
55+
'react-native/sort-styles': 'off',
56+
'react-native/no-color-literals': 'off',
57+
'react-hooks/rules-of-hooks': 'error',
58+
'react-hooks/exhaustive-deps': 'warn',
59+
'@typescript-eslint/explicit-module-boundary-types': 'warn',
60+
'@typescript-eslint/no-explicit-any': 'error',
61+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], // Allow unused vars starting with _
62+
'import/default': 'off', // Disable for now due to react-native-select-dropdown issues
63+
},
64+
settings: {
65+
'react': {
66+
version: 'detect',
67+
},
68+
'import/resolver': {
69+
typescript: {},
70+
},
71+
'import/core-modules': ['@env'],
72+
'import/ignore': ['react-native', '@env'],
73+
},
74+
overrides: [
75+
// Configuration files can use require()
76+
{
77+
files: ['**/*.config.js', '**/babel.config.js'],
78+
rules: {
79+
'@typescript-eslint/no-require-imports': 'off',
80+
},
81+
},
82+
// Test files
83+
{
84+
files: ['**/*.test.js', '**/*.test.ts', '**/e2e/**/*.js'],
85+
env: {
86+
jest: true,
87+
},
88+
rules: {
89+
'@typescript-eslint/explicit-module-boundary-types': 'off',
90+
},
91+
},
92+
// Example directory - less strict for demo code
93+
{
94+
files: ['example/**/*'],
95+
rules: {
96+
'@typescript-eslint/explicit-module-boundary-types': 'off',
97+
},
98+
},
99+
],
100+
};

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,8 @@ jobs:
232232
yarn turbo run build:android:odrd --cache-dir="${{ env.TURBO_CACHE_DIR }}"
233233
234234
build-ios-lmfs:
235-
runs-on: macos-14
235+
runs-on:
236+
labels: macos-latest-xlarge
236237
timeout-minutes: 45
237238
env:
238239
TURBO_CACHE_DIR: .turbo/ios
@@ -288,7 +289,8 @@ jobs:
288289
yarn turbo run build:ios:lmfs --cache-dir="${{ env.TURBO_CACHE_DIR }}"
289290
290291
build-ios-odrd:
291-
runs-on: macos-14
292+
runs-on:
293+
labels: macos-latest-xlarge
292294
timeout-minutes: 45
293295
env:
294296
TURBO_CACHE_DIR: .turbo/ios

.github/workflows/release-please.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
name: release-please
15+
## Runs the release-please action for all new pushes to the main branch.
16+
## This will create new release-PRs, create GitHub releases,
17+
## and update the CHANGELOG.md.
18+
19+
name: Release Please
1620

1721
on:
1822
push:
19-
branches:
20-
- main
23+
branches: [main]
24+
workflow_dispatch:
2125

2226
concurrency:
2327
group: ${{ github.workflow }}-${{ github.ref }}
@@ -31,6 +35,8 @@ jobs:
3135
release-please:
3236
runs-on: ubuntu-latest
3337
steps:
34-
- uses: googleapis/release-please-action@d1a8f221d7723166f48a584aebba00ef3f6febec
38+
- id: release
39+
name: Release Please
40+
uses: googleapis/release-please-action@v4
3541
with:
3642
token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Keys.plist
3939
.idea
4040
.project
4141
.settings
42+
.kotlin
4243
local.properties
4344
android.iml
4445

@@ -47,6 +48,10 @@ android.iml
4748
example/**/ios/Pods
4849
example/**/ios/Podfile.lock
4950

51+
# Ruby
52+
example/**/vendor/
53+
Gemfile.lock
54+
5055
# node.js
5156
#
5257
node_modules/

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v18
1+
v22

.yarn/releases/yarn-3.6.4.cjs

Lines changed: 874 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ plugins:
2121
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
2222
spec: "@yarnpkg/plugin-workspace-tools"
2323

24-
yarnPath: .yarn/releases/yarn-3.6.1.cjs
24+
yarnPath: .yarn/releases/yarn-3.6.4.cjs

README.md

Lines changed: 86 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,31 @@ If your billing address is in the European Economic Area, effective on 8 July 20
88

99
This is the beta release of the Google Driver SDK package for React Native. It is an early look at the package and is intended for testing and feedback collection. The functionalities and APIs in this version are subject to change.
1010

11+
> [!NOTE]
12+
> This package is in Beta until it reaches version 1.0. According to [semantic versioning](https://semver.org/#spec-item-4), breaking changes may be introduced before 1.0.
13+
1114
## Requirements
1215

1316
| | Android | iOS |
1417
| ------------------------------- | ------- | --------- |
15-
| **Minimum mobile OS supported** | SDK 23+ | iOS 16.0+ |
18+
| **Minimum mobile OS supported** | SDK 24+ | iOS 16.0+ |
1619

1720
* A React Native project
18-
* A Google Cloud project with the [Navigation SDK enabled](https://developers.google.com/maps/documentation/navigation/android-sdk/set-up-project) and the [Maps SDK for iOS enabled](https://developers.google.com/maps/documentation/navigation/ios-sdk/config)
19-
* An API key from the project above
21+
* A Google Cloud project
22+
* If you are a Mobility Services developer, you must contact Sales as described in [Mobility services documentation](https://developers.google.com/maps/documentation/transportation-logistics/mobility).
23+
* If you are not a Mobility Services developer, refer to [Setup Google Cloud Project](https://developers.google.com/maps/documentation/navigation/android-sdk/cloud-setup) for instructions.
24+
* An [API key](https://console.cloud.google.com/google/maps-apis/credentials) from the project above
25+
* The API key must be configured for both Android and iOS. Refer to [Android Using Api Keys](https://developers.google.com/maps/documentation/navigation/android-sdk/get-api-key) and [iOS Using Api Keys](https://developers.google.com/maps/documentation/navigation/ios-sdk/get-api-key) respectively for instructions.
2026
* If targeting Android, [Google Play Services](https://developers.google.com/android/guides/overview) installed and enabled
21-
* [Attributions and licensing text](https://developers.google.com/maps/documentation/navigation/android-sdk/set-up-project#include_the_required_attributions_in_your_app) added to your app.
22-
* Install the [react-native-navigation-sdk](https://github.com/googlemaps/react-native-navigation-sdk) library on your application and set up a `NavigationView`.
27+
* [Attributions and licensing text](https://developers.google.com/maps/documentation/navigation/android-sdk/set-up-project#include_the_required_attributions_in_your_app) added to your app
28+
29+
> [!IMPORTANT]
30+
> [Apply API restrictions](https://developers.google.com/maps/api-security-best-practices#api-restriction) to the API key to limit usage to "Navigation SDK, "Maps SDK for Android", and "Maps SDK for iOS" for enhanced security and cost management. This helps guard against unauthorized use of your API key.
2331
32+
## React Native Compatibility
33+
34+
> [!IMPORTANT]
35+
> This package does not yet support React Native's new architecture. Make sure the new architecture is disabled in your project configuration as shown in the [Installation](#installation) section.
2436
2537
## Installation
2638

@@ -48,41 +60,88 @@ This is the beta release of the Google Driver SDK package for React Native. It i
4860

4961
### Android
5062

51-
1. Set the `minSdkVersion` in `android/app/build.gradle`:
63+
64+
#### Disable new architecture
65+
66+
This package does not yet support new architecture. Make sure new architecture is disabled in your `android/gradle.properties` file:
67+
68+
```groovy
69+
newArchEnabled=false
70+
```
71+
72+
#### Enable Jetifier
73+
74+
To ensure compatibility with AndroidX, enable Jetifier in your `android/gradle.properties` file:
75+
76+
```groovy
77+
# Automatically convert third-party libraries to use AndroidX
78+
android.enableJetifier=true
79+
```
80+
81+
#### Enable Core Library Desugaring
82+
83+
Core library desugaring **must be enabled** for your Android project, regardless of your minSdkVersion.
84+
85+
To enable desugaring, update your `android/app/build.gradle` file:
5286

5387
```groovy
5488
android {
55-
defaultConfig {
56-
minSdkVersion 23
89+
...
90+
compileOptions {
91+
coreLibraryDesugaringEnabled true
92+
...
5793
}
5894
}
95+
96+
dependencies {
97+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.0.4'
98+
}
5999
```
60100

61-
2. **Enable Core Library Desugaring**
101+
#### Minimum SDK Requirements for Android
62102

63-
Core library desugaring **must be enabled** for your Android project, regardless of your minSdkVersion.
103+
The `minSdkVersion` for your Android project must be set to 24 or higher in `android/app/build.gradle`:
64104

65-
To enable desugaring, update your `android/app/build.gradle` file:
105+
```groovy
106+
android {
107+
defaultConfig {
108+
minSdkVersion 24
109+
}
110+
}
111+
```
66112

67-
```groovy
68-
android {
69-
...
70-
compileOptions {
71-
coreLibraryDesugaringEnabled true
72-
...
73-
}
74-
}
113+
#### Set Google Maps API Key
75114

76-
dependencies {
77-
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.0.4'
78-
}
79-
```
115+
To securely store your API key, it is recommended to use the [Google Maps Secrets Gradle Plugin](https://developers.google.com/maps/documentation/android-sdk/secrets-gradle-plugin). This plugin helps manage API keys without exposing them in your app's source code.
116+
117+
See example configuration for secrets plugin at example applications [build.gradle](./example/android/app/build.gradle) file.
80118
81119
### iOS
82120
83-
1. Set the iOS version in your application PodFile.
121+
#### Disable new architecture
122+
123+
This package does not yet support new architecture. Make sure new architecture is disabled in your `ios/Podfile`:
84124
85-
`platform: ios, '16.0'`
125+
```ruby
126+
ENV['RCT_NEW_ARCH_ENABLED'] = '0'
127+
```
128+
129+
#### Set Google Maps API Key
130+
131+
To set up, specify your API key in the application delegate `ios/Runner/AppDelegate.m`:
132+
133+
```objective-c
134+
#import <GoogleMaps/GoogleMaps.h>
135+
136+
@implementation AppDelegate
137+
138+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
139+
{
140+
[GMSServices provideAPIKey:@"API_KEY"];
141+
return [super application:application didFinishLaunchingWithOptions:launchOptions];
142+
}
143+
144+
```
86145
87146
## Usage
88147
@@ -274,9 +333,9 @@ See the [Contributing guide](./CONTRIBUTING.md).
274333
275334
## Terms of Service
276335
277-
This package uses Google Maps Platform services, and any use of Google Maps Platform is subject to the [Terms of Service](https://cloud.google.com/maps-platform/terms).
336+
This library uses Google Maps Platform services. Use of Google Maps Platform services through this library is subject to the [Google Maps Platform Terms of Service](https://cloud.google.com/maps-platform/terms).
278337
279-
For clarity, this package, and each underlying component, is not a Google Maps Platform Core Service.
338+
This library is not a Google Maps Platform Core Service. Therefore, the Google Maps Platform Terms of Service (e.g. Technical Support Services, Service Level Agreements, and Deprecation Policy) do not apply to the code in this library.
280339
281340
## Support
282341
-42.4 KB
Binary file not shown.

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)