Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/**
* Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
env: {
'es2021': true,
'node': true,
'react-native/react-native': true,
},
plugins: [
'@typescript-eslint',
'react',
'react-hooks',
'react-native',
'import',
'prettier',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:react-native/all',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:prettier/recommended',
],
rules: {
'prettier/prettier': 'warn',
'react/react-in-jsx-scope': 'off',
'react-native/no-inline-styles': 'off',
'react-native/sort-styles': 'off',
'react-native/no-color-literals': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'@typescript-eslint/explicit-module-boundary-types': 'warn',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], // Allow unused vars starting with _
'import/default': 'off', // Disable for now due to react-native-select-dropdown issues
},
settings: {
'react': {
version: 'detect',
},
'import/resolver': {
typescript: {},
},
'import/core-modules': ['@env'],
'import/ignore': ['react-native', '@env'],
},
overrides: [
// Configuration files can use require()
{
files: ['**/*.config.js', '**/babel.config.js'],
rules: {
'@typescript-eslint/no-require-imports': 'off',
},
},
// Test files
{
files: ['**/*.test.js', '**/*.test.ts', '**/e2e/**/*.js'],
env: {
jest: true,
},
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
},
// Example directory - less strict for demo code
{
files: ['example/**/*'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
},
],
};
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ jobs:
yarn turbo run build:android:odrd --cache-dir="${{ env.TURBO_CACHE_DIR }}"

build-ios-lmfs:
runs-on: macos-14
runs-on:
labels: macos-latest-xlarge
timeout-minutes: 45
env:
TURBO_CACHE_DIR: .turbo/ios
Expand Down Expand Up @@ -288,7 +289,8 @@ jobs:
yarn turbo run build:ios:lmfs --cache-dir="${{ env.TURBO_CACHE_DIR }}"

build-ios-odrd:
runs-on: macos-14
runs-on:
labels: macos-latest-xlarge
timeout-minutes: 45
env:
TURBO_CACHE_DIR: .turbo/ios
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: release-please
## Runs the release-please action for all new pushes to the main branch.
## This will create new release-PRs, create GitHub releases,
## and update the CHANGELOG.md.

name: Release Please

on:
push:
branches:
- main
branches: [main]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -31,6 +35,8 @@ jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@d1a8f221d7723166f48a584aebba00ef3f6febec
- id: release
name: Release Please
uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Keys.plist
.idea
.project
.settings
.kotlin
local.properties
android.iml

Expand All @@ -47,6 +48,10 @@ android.iml
example/**/ios/Pods
example/**/ios/Podfile.lock

# Ruby
example/**/vendor/
Gemfile.lock

# node.js
#
node_modules/
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18
v22
874 changes: 874 additions & 0 deletions .yarn/releases/yarn-3.6.4.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"

yarnPath: .yarn/releases/yarn-3.6.1.cjs
yarnPath: .yarn/releases/yarn-3.6.4.cjs
113 changes: 86 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,31 @@ If your billing address is in the European Economic Area, effective on 8 July 20

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.

> [!NOTE]
> 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.

## Requirements

| | Android | iOS |
| ------------------------------- | ------- | --------- |
| **Minimum mobile OS supported** | SDK 23+ | iOS 16.0+ |
| **Minimum mobile OS supported** | SDK 24+ | iOS 16.0+ |

* A React Native project
* 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)
* An API key from the project above
* A Google Cloud project
* 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).
* 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.
* An [API key](https://console.cloud.google.com/google/maps-apis/credentials) from the project above
* 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.
* If targeting Android, [Google Play Services](https://developers.google.com/android/guides/overview) installed and enabled
* [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.
* Install the [react-native-navigation-sdk](https://github.com/googlemaps/react-native-navigation-sdk) library on your application and set up a `NavigationView`.
* [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

> [!IMPORTANT]
> [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.

## React Native Compatibility

> [!IMPORTANT]
> 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.

## Installation

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

### Android

1. Set the `minSdkVersion` in `android/app/build.gradle`:

#### Disable new architecture

This package does not yet support new architecture. Make sure new architecture is disabled in your `android/gradle.properties` file:

```groovy
newArchEnabled=false
```

#### Enable Jetifier

To ensure compatibility with AndroidX, enable Jetifier in your `android/gradle.properties` file:

```groovy
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
```

#### Enable Core Library Desugaring

Core library desugaring **must be enabled** for your Android project, regardless of your minSdkVersion.

To enable desugaring, update your `android/app/build.gradle` file:

```groovy
android {
defaultConfig {
minSdkVersion 23
...
compileOptions {
coreLibraryDesugaringEnabled true
...
}
}

dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.0.4'
}
```

2. **Enable Core Library Desugaring**
#### Minimum SDK Requirements for Android

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

To enable desugaring, update your `android/app/build.gradle` file:
```groovy
android {
defaultConfig {
minSdkVersion 24
}
}
```

```groovy
android {
...
compileOptions {
coreLibraryDesugaringEnabled true
...
}
}
#### Set Google Maps API Key

dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.0.4'
}
```
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.

See example configuration for secrets plugin at example applications [build.gradle](./example/android/app/build.gradle) file.

### iOS

1. Set the iOS version in your application PodFile.
#### Disable new architecture

This package does not yet support new architecture. Make sure new architecture is disabled in your `ios/Podfile`:

`platform: ios, '16.0'`
```ruby
ENV['RCT_NEW_ARCH_ENABLED'] = '0'
```

#### Set Google Maps API Key

To set up, specify your API key in the application delegate `ios/Runner/AppDelegate.m`:

```objective-c
#import <GoogleMaps/GoogleMaps.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[GMSServices provideAPIKey:@"API_KEY"];
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}

```

## Usage

Expand Down Expand Up @@ -274,9 +333,9 @@ See the [Contributing guide](./CONTRIBUTING.md).

## Terms of Service

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).
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).

For clarity, this package, and each underlying component, is not a Google Maps Platform Core Service.
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.

## Support

Expand Down
Binary file removed android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 0 additions & 7 deletions android/gradle/wrapper/gradle-wrapper.properties

This file was deleted.

12 changes: 10 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

module.exports = {
presets: ['module:@react-native/babel-preset'],
overrides: [
{
exclude: /\/node_modules\//,
presets: ['module:react-native-builder-bob/babel-preset'],
},
{
include: /\/node_modules\//,
presets: ['module:@react-native/babel-preset'],
},
],
};
15 changes: 11 additions & 4 deletions example/LMFS/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"

# Cocoapods 1.15 introduced a bug which break the build. The upper
# bound in can be removed with next React Native release >0.74.1.
gem 'cocoapods', '>= 1.13', '< 1.15'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'
gem 'concurrent-ruby', '< 1.3.4'

# Ruby 3.4.0 has removed some libraries from the standard library.
gem 'bigdecimal'
gem 'logger'
gem 'benchmark'
gem 'mutex_m'
4 changes: 2 additions & 2 deletions example/LMFS/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ def enableProguardInReleaseBuilds = true
* The preferred build flavor of JavaScriptCore (JSC)
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
* `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'
def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'

android {
ndkVersion rootProject.ext.ndkVersion
Expand Down
Loading