Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.facebook.react.module.model.ReactModuleInfo;
import com.facebook.react.module.model.ReactModuleInfoProvider;
import com.facebook.react.uimanager.ViewManager;
import com.google.android.libraries.navigation.NavigationApi;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
Expand All @@ -28,6 +29,10 @@
@DoNotStrip
public class Package extends BaseReactPackage {

static {
NavigationApi.addInternalUsageAttributionId(SdkVersion.ATTRIBUTION_ID);
}

@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
List<ViewManager> viewManagers = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* 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.navsdk;

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

public static final String ATTRIBUTION_ID = "gmp_git_reactnativenavigationsdk_v" + VERSION;
Copy link
Copy Markdown
Member

@caio1985 caio1985 Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use gmp_git_reactnativenavigationsdk_v0_android


private SdkVersion() {}
}
5 changes: 5 additions & 0 deletions ios/react-native-navigation-sdk/NavModule.mm
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
*/

#import "NavModule.h"
#import <GoogleMaps/GoogleMaps.h>
#import "NavAutoModule.h"
#import "NavViewModule.h"
#import "ObjectTranslationUtil.h"
#import "SdkVersion.h"

using namespace JS::NativeNavModule;

Expand Down Expand Up @@ -50,6 +52,9 @@ + (id)allocWithZone:(NSZone *)zone {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedInstance = [super allocWithZone:zone];
NSString *attributionId =
[NSString stringWithFormat:@"gmp_git_reactnativenavigationsdk_v%@", kRNNavSdkVersion];
Copy link
Copy Markdown
Member

@caio1985 caio1985 Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use gmp_git_reactnativenavigationsdk_v0_ios

[GMSServices addInternalUsageAttributionID:attributionId];
});
return sharedInstance;
}
Expand Down
19 changes: 19 additions & 0 deletions ios/react-native-navigation-sdk/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 kRNNavSdkVersion = @"0.15.1"; // 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-navigation-sdk",
"changelog-path": "CHANGELOG.md"
"changelog-path": "CHANGELOG.md",
"extra-files": [
"android/src/main/java/com/google/android/react/navsdk/SdkVersion.java",
"ios/react-native-navigation-sdk/SdkVersion.h"
]
}
}
}
Loading