{"id":49689817,"url":"https://github.com/googlemaps/react-native-driver-sdk","last_synced_at":"2026-05-07T13:25:33.584Z","repository":{"id":329269220,"uuid":"781215682","full_name":"googlemaps/react-native-driver-sdk","owner":"googlemaps","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-04T06:18:40.000Z","size":3496,"stargazers_count":4,"open_issues_count":21,"forks_count":0,"subscribers_count":20,"default_branch":"main","last_synced_at":"2026-05-04T08:17:15.073Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/googlemaps.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-04-03T00:46:56.000Z","updated_at":"2026-05-04T06:15:32.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/googlemaps/react-native-driver-sdk","commit_stats":null,"previous_names":["googlemaps/react-native-driver-sdk"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/googlemaps/react-native-driver-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlemaps%2Freact-native-driver-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlemaps%2Freact-native-driver-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlemaps%2Freact-native-driver-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlemaps%2Freact-native-driver-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/googlemaps","download_url":"https://codeload.github.com/googlemaps/react-native-driver-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlemaps%2Freact-native-driver-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32739424,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-07T13:25:32.635Z","updated_at":"2026-05-07T13:25:33.574Z","avatar_url":"https://github.com/googlemaps.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Native: DriverSDK Library\n\n**European Economic Area (EEA) developers**\n\nIf your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](https://developers.google.com/maps/comms/eea/faq).\n\n## Description\n\nThis 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.\n\n\u003e [!NOTE]\n\u003e 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.\n\n## Requirements\n\n|                                 | Android | iOS       |\n| ------------------------------- | ------- | --------- |\n| **Minimum mobile OS supported** | SDK 26+ | iOS 16.0+ |\n| **Compile/Target SDK**          | SDK 36+ | -         |\n\n* A React Native project\n* A Google Cloud project\n  *  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).\n  *  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.\n* An [API key](https://console.cloud.google.com/google/maps-apis/credentials) from the project above\n  * 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.\n* If targeting Android, [Google Play Services](https://developers.google.com/android/guides/overview) installed and enabled\n* [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\n\n\u003e [!IMPORTANT]\n\u003e [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.\n\n## React Native Compatibility\n\n\u003e [!IMPORTANT]\n\u003e This package requires React Native 0.79+ with the new architecture (TurboModules) enabled. Make sure the new architecture is enabled in your project configuration as shown in the [Installation](#installation) section.\n\n\u003e [!NOTE]\n\u003e For users upgrading from versions prior to 0.5.0, please refer to the [Migration Guide](./MIGRATING.md) for instructions on migrating to the new architecture.\n\n## Installation\n\n1. This repository is currently private. In order to install the library, you must authenticate with SSH first. See [Connecting to GitHub with SSH](https://docs.github.com/en/authentication/connecting-to-github-with-ssh) for instructions on how to provide SSH keys.\n\n1. To install the library run the following command from your project root: \n\n    ```bash\n    npm install --save https://github.com/googlemaps/react-native-driver-sdk#{version_tag}\n    ```\n    or\n    ```bash\n    yarn add @googlemaps/react-native-driver-sdk@https://github.com/googlemaps/react-native-driver-sdk#{version_tag}\n    ```\n\n1. Install the `@googlemaps/react-native-navigation-sdk` dependency:\n\n    ```bash\n    npm install --save @googlemaps/react-native-navigation-sdk\n    ```\n    or\n    ```bash\n    yarn add @googlemaps/react-native-navigation-sdk\n    ```\n\n### Android\n\n\n#### Enable new architecture\n\nThis package requires the new architecture. Make sure new architecture is enabled in your `android/gradle.properties` file:\n\n```groovy\nnewArchEnabled=true\n```\n\n#### Enable Jetifier\n\nTo ensure compatibility with AndroidX, enable Jetifier in your `android/gradle.properties` file:\n\n```groovy\n# Automatically convert third-party libraries to use AndroidX\nandroid.enableJetifier=true\n```\n\n#### Enable Core Library Desugaring\n\nCore library desugaring **must be enabled** for your Android project, regardless of your minSdkVersion.\n\nTo enable desugaring, update your `android/app/build.gradle` file:\n\n```groovy\nandroid {\n    ...\n    compileOptions {\n        coreLibraryDesugaringEnabled true\n        ...\n    }\n}\n\ndependencies {\n    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.0.4'\n}\n```\n\n#### Minimum SDK Requirements for Android\n\nThe `minSdkVersion` for your Android project must be set to 26 or higher in `android/app/build.gradle`:\n\n```groovy\nandroid {\n    defaultConfig {\n        minSdkVersion 26\n    }\n}\n```\n\nThe `compileSdkVersion` and `targetSdkVersion` should be set to 36 or higher.\n\n#### Set Google Maps API Key\n\nTo 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.\n\nSee example configuration for secrets plugin at example applications [build.gradle](./example/android/app/build.gradle) file.\n\n### iOS\n\n#### Enable new architecture\n\nThis package requires the new architecture. Make sure new architecture is enabled in your `ios/Podfile`:\n\n```ruby\nENV['RCT_NEW_ARCH_ENABLED'] = '1'\n```\n\n#### Set Google Maps API Key\n\nTo set up, specify your API key in the application delegate `ios/Runner/AppDelegate.m`:\n\n```objective-c\n#import \u003cGoogleMaps/GoogleMaps.h\u003e\n\n@implementation AppDelegate\n\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n{\n  [GMSServices provideAPIKey:@\"API_KEY\"];\n  return [super application:application didFinishLaunchingWithOptions:launchOptions];\n}\n\n```\n\n## Usage\n\n### Ridesharing\n#### Initializing the API\n\n1. As mentioned above, this library depends on the React Native: NavigationSDK library. Specifically, it depends on the existence of a `NavigationView` component in the application. \n\n1. In your react-native component, import and instantiate the RidesharingDriverapi and reference it through variable.\n\n    ```typescript\n            import RidesharingDriverApi from \"@googlemaps/react-native-driver-sdk\";\n\n            const ridesharing = new RidesharingDriverapi();\n    ```\n\n2. Start navigation. Please refer to the Navigation SDK [Sample app](https://github.com/googlemaps/react-native-navigation-sdk/tree/main/example) for all details on how to set up the navigation component and its listeners.\n     \n      ```typescript\n          const { navigationController } = useNavigation();\n          ...\n          await navigationController.init();\n      ```\n\n3. Second step is to initialize the Api. Navigation must be initialized before the Driver SDK is initialized.\n\n    ```typescript\n        await ridesharingDriverApi.initialize(\n          PROVIDER_ID,\n          VEHICLE_ID,\n          async (tokenContext) =\u003e {\n            // Fetch a fresh token from your backend.\n            // tokenContext.vehicleId contains the vehicle ID that needs the token.\n            const token = await fetchTokenFromBackend(tokenContext.vehicleId);\n            return token;\n          },\n          // Android only — on iOS, use vehicleReporter.setOnVehicleUpdateSucceed/setOnVehicleUpdateFailed instead.\n          (statusLevel, statusCode, message) =\u003e {\n            console.log(\"onStatusUpdate: \" + statusLevel + \" \" + statusCode + \" \" + message);\n          }\n        );\n    ```\n\nNote: The `initialize` method takes an `onGetToken` callback as parameter. This callback is invoked by the native SDK whenever a fresh auth token is needed (e.g. on each location update cycle). The callback receives an `AuthTokenContext` with the `vehicleId` and should return a `Promise\u003cstring\u003e` that resolves to a valid token. Always fetch a fresh token in this callback rather than caching one.\n\n\nThe vehicle reporter allows developers to enable/disable location reporting to Fleet Engine, as well as to report changes in the vehicle state (E.g. Online or Offline).\n\n```typescript\n  const vehicleReporter = ridesharingDriverApi.getRidesharingVehicleReporter()\n  await vehicleReporter.setLocationTrackingEnabled(true);\n  await vehicleReporter.setVehicleState(VehicleState.ONLINE);\n```\n\n### Delivery\n#### Initializing the API\n\n1. As mentioned above, this library depends on the React Native: NavigationSDK library. Specifically, it depends on the existence of a `NavigationView` component in the application. Please refer to the Navigation SDK [Sample app](https://github.com/googlemaps/react-native-navigation-sdk/tree/main/SampleApp) for all details on how to set up the navigation component.\n\n1. In your react-native component, import and instantiate the RidesharingDriverapi and reference it through variable.\n\n    ```typescript\n            import DeliveryDriverApi from \"@googlemaps/react-native-driver-sdk\";\n\n            const deliveryApi = new DeliveryDriverapi();\n    ```\n\n2. Second step is to initialize the Api.\n\n    ```typescript\n        await deliveryApi.initialize(\n          PROVIDER_ID,\n          DELIVERY_VEHICLE_ID,\n          async (tokenContext) =\u003e {\n            // Fetch a fresh token from your backend.\n            // tokenContext.vehicleId contains the vehicle ID that needs the token.\n            // tokenContext.taskId may contain the task ID for delivery-specific tokens.\n            const token = await fetchTokenFromBackend(tokenContext.vehicleId);\n            return token;\n          },\n          // Android only — on iOS, use vehicleReporter.setOnVehicleUpdateSucceed/setOnVehicleUpdateFailed instead.\n          (statusLevel, statusCode, message) =\u003e {\n            console.log(\"onStatusUpdate: \" + statusLevel + \" \" + statusCode + \" \" + message);\n          }\n        );\n    ```\n\nNote: The `initialize` method takes an `onGetToken` callback as parameter. This callback is invoked by the native SDK whenever a fresh auth token is needed (e.g. on each location update cycle). The callback receives an `AuthTokenContext` with the `vehicleId` (and optionally `taskId` for delivery) and should return a `Promise\u003cstring\u003e` that resolves to a valid token. Always fetch a fresh token in this callback rather than caching one.\n\n\n#### Getting a `DeliveryVehicleReporter`\n\nThe vehicle reporter allows developers to enable/disable location reporting to Fleet Engine.\n\n```typescript\n  const vehicleReporter = deliveryApi.getDeliveryVehicleReporter()\n  await vehicleReporter.setLocationTrackingEnabled(true);\n```\n\n#### Getting a `DeliveryVehicleManager`\n\nThe vehicle manager allows developers to fetch the `DeliveryVehicle` linked to the Driver Api from Fleet Engine.\n\n```typescript\n  const vehicleManager = deliveryApi.getDeliveryVehicleManager()\n  const deliveryVehicle = await vehicleManager.getDeliveryVehicle();\n  console.log(deliveryVehicle.vehicleName, deliveryVehicle.vehicleId, deliveryVehicle.vehicleStops);\n```\n\n### Other APIs\n\n#### Set update interval status (seconds) - RideSharingAPI \u0026 DeliveryDriverAPI:\n\nTo set the time interval of your vehicle updates, you can use the **setLocationReportingInterval** method of the Driver Api's. Pass the value in seconds of your preferred interval. See the sample code below where location will be updated every 20 seconds:\n\n```typescript\n  await driverApi.setLocationReportingInterval(20);\n```\n\n#### Get the Driver SDK version: - RideSharingAPI \u0026 DeliveryDriverAPI:\n\nTo get the DriverSDK version being used, you can call the **getDriverSdkVersion** method. See the sample code below:\n\n```typescript\n  const sdkVersion = await driverApi.getDriverSdkVersion();\n```\n\n### List of functions in ODRD\n\n| Function                                                          | Description                                                                                                                            |\n| ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |\n| `RidesharingDriverApi.initialize`                                 | Create the instance of RidesharingAPI.                                                                                                 |\n| `RidesharingDriverApi.getRidesharingVehicleReporter`              | Vehicle reporter for the vehicle that reports location and vehicle state to Fleet Engine. An app is allowed only one vehicle reporter. |\n| `RidesharingVehicleReporter.setLocationTrackingEnabled(boolean)`  | Enable/disabled location tracking(logs).                                                                                               |\n| `RidesharingVehicleReporter.setVehicleState(VehicleState)`        | Set vehicle state to Online/Offline to Fleet Engine.                                                                                   |\n| `RidesharingVehicleReporter.setLocationReportingInterval(number)` | Set the reporting interval(seconds).                                                                                                   |\n| `RidesharingDriverApi.getDriverSdkVersion()`                      | Get native driversdk version.                                                                                                          |\n| `RidesharingDriverApi.clearInstance()`                            | Clear the api instance.                                                                                                                |\n| `RidesharingDriverApi.setAbnormalTerminationReporting(boolean)`   | Enable/disable abnormal termination reporting.                                                                                         |\n\n\n### List of functions in LMFS\n\n| Function                                                           | Description                                                                                                                      |\n| ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |\n| `DeliveryDriverApi.initialize`                                     | Create the instance of DeliveryDriverAPI.                                                                                        |\n| `DeliveryDriverApi.getDeliveryVehicleReporter`                     | Vehicle reporter for a delivery vehicle that reports location and stop information. An app is allowed only one vehicle reporter. |\n| `DeliveryDriverApi.getDeliveryVehicleManager`                      | Returns a vehicle manager that can be used to fetch the delivery vehicle from Fleet Engine                                       |\n| `DeliveryVehicleReporter.setLocationTrackingEnabled(boolean)`      | Enable/disabled location tracking(logs).                                                                                         |\n| `DeliveryVehicleReporter.setLocationReportingInterval(number)`     | Set the log interval(seconds).                                                                                                   |\n| `DeliveryVehicleReporter.getDriverSdkVersion()`                    | Get delivery driversdk version.                                                                                                  |  |\n| `DeliveryVehicleManager.getDeliveryVehicle()`                      | Fetch the delivery vehicle from Fleet Engine                                                                                     |\n| `DeliveryVehicleReporter.clearInstance()`                          | Clear instance.                                                                                                                  |\n| `DeliveryVehicleReporter.setAbnormalTerminationReporting(boolean)` | Enable/disable abnormal termination reporting.                                                                                   |\n\n### Requesting and handling permissions\n\nThe Google Navigation SDK React Native library offers functionalities that necessitate specific permissions from the mobile operating system. These include, but are not limited to, location services, background execution, and receiving background location updates.\n\n\u003e [!NOTE]\n\u003e The management of these permissions falls outside the scope of the Navigation SDKs for Android and iOS. As a developer integrating these SDKs into your applications, you are responsible for requesting and obtaining the necessary permissions from the users of your app.\n\nYou can see example of handling permissions in the [app.tsx](./SampleApp/src/app.tsx) file of the sample application:\n\n```tsx\nimport {request, PERMISSIONS, RESULTS} from 'react-native-permissions';\n\n// ...\n\n// Request permission for accessing the device's location.\nconst requestPermissions = async () =\u003e {\n    const result = await request(\n        Platform.OS ==\"android\" ? \n            PERMISSIONS.ANDROID.ACCESS_COARSE_LOCATION : \n            PERMISSIONS.IOS.LOCATION_ALWAYS,\n    );\n\n    if (result == RESULTS.GRANTED) {\n        setArePermissionsApproved(true);\n    } else {\n        Snackbar.show({\n            text: 'Permissions are needed to proceed with the app. Please re-open and accept.',\n            duration: Snackbar.LENGTH_SHORT,\n        });\n    }\n};\n```\n\n\n## Contributing\n\nSee the [Contributing guide](./CONTRIBUTING.md).\n\n## Terms of Service\n\nThis 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).\n\nThis 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.\n\n## Support\n\nThis package is offered via an open source license. It is not governed by the Google Maps Platform Support [Technical Support Services Guidelines](https://cloud.google.com/maps-platform/terms/tssg), the [SLA](https://cloud.google.com/maps-platform/terms/sla), or the [Deprecation Policy](https://cloud.google.com/maps-platform/terms) (however, any Google Maps Platform services used by the library remain subject to the Google Maps Platform Terms of Service).\n\nThis package adheres to [semantic versioning](https://semver.org/) to indicate when backwards-incompatible changes are introduced. Accordingly, while the library is in version 0.x, backwards-incompatible changes may be introduced at any time. \n\nIf you find a bug, or have a feature request, please [file an issue](https://github.com/googlemaps/react-native-navigation-sdk/issues) on GitHub. If you would like to get answers to technical questions from other Google Maps Platform developers, ask through one of our [developer community channels](https://developers.google.com/maps/developer-community). If you'd like to contribute, please check the [Contributing guide](https://github.com/googlemaps/react-native-navigation-sdk/blob/main/CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglemaps%2Freact-native-driver-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgooglemaps%2Freact-native-driver-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglemaps%2Freact-native-driver-sdk/lists"}