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
Binary file removed .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ repositories {

dependencies {
implementation 'com.google.android.libraries.mapsplatform.transportation:transportation-driver:7.0.0'
implementation 'androidx.startup:startup-runtime:1.2.0'
implementation 'com.facebook.react:react-native:+'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
api 'com.google.guava:guava:31.0.1-android'
Expand Down
14 changes: 12 additions & 2 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.android.react.driversdk">
xmlns:tools="http://schemas.android.com/tools"
package="com.google.android.react.driversdk">
<application>
<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="${applicationId}.androidx-startup"
android:exported="false"
tools:node="merge">
<meta-data
android:name="com.google.android.react.driversdk.DriverSdkInitializer"
android:value="androidx.startup" />
</provider>
</application>
</manifest>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright 2026 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.
*/

package com.google.android.react.driversdk;

import android.content.Context;
import androidx.annotation.NonNull;
import androidx.startup.Initializer;
import com.google.android.gms.maps.MapsApiSettings;
import java.util.Collections;
import java.util.List;

/** Registers the Driver SDK internal usage attribution ID at application startup. */
public final class DriverSdkInitializer implements Initializer<Void> {

@NonNull
@Override
public Void create(@NonNull Context context) {
MapsApiSettings.addInternalUsageAttributionId(
context.getApplicationContext(), SdkVersion.ATTRIBUTION_ID);
return null;
}

@NonNull
@Override
public List<Class<? extends Initializer<?>>> dependencies() {
return Collections.emptyList();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright 2026 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.
*/

package com.google.android.react.driversdk;

/** SDK version constants for internal usage attribution. */
public final class SdkVersion {
public static final String VERSION = "0.4.0"; // {x-release-please-version}

public static final String ATTRIBUTION_ID =
"gmp_git_reactnativedriversdk_v" + VERSION + "_android";

private SdkVersion() {}
}
Binary file removed example/.DS_Store
Binary file not shown.
Binary file removed example/LMFS/.DS_Store
Binary file not shown.
Binary file removed example/ODRD/.DS_Store
Binary file not shown.
Binary file removed ios/.DS_Store
Binary file not shown.
29 changes: 29 additions & 0 deletions ios/RNDriverSdkAttribution.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright 2026 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.

#import <GoogleMaps/GoogleMaps.h>
#import "SdkVersion.h"

@interface RNDriverSdkAttribution : NSObject
@end

@implementation RNDriverSdkAttribution

+ (void)load {
NSString *attributionId =
[NSString stringWithFormat:@"gmp_git_reactnativedriversdk_v%@_ios", kRNDriverSdkVersion];
[GMSServices addInternalUsageAttributionID:attributionId];
}

@end
19 changes: 19 additions & 0 deletions ios/SdkVersion.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2026 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.
*/

#import <Foundation/Foundation.h>

static NSString *const kRNDriverSdkVersion = @"0.4.0"; // x-release-please-version
6 changes: 5 additions & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
"packages": {
".": {
"package-name": "@googlemaps/react-native-driver-sdk",
"changelog-path": "CHANGELOG.md"
"changelog-path": "CHANGELOG.md",
"extra-files": [
"android/src/main/java/com/google/android/react/driversdk/SdkVersion.java",
"ios/SdkVersion.h"
]
}
}
}
Loading