From e179fdb54c8d3c9cfc141087ffc497e55462e040 Mon Sep 17 00:00:00 2001 From: Subhodip Date: Wed, 3 Dec 2025 21:31:10 +0530 Subject: [PATCH 1/4] feat: add API-level usage attribution for component tracking. --- .../include/GMUClusterManager.m | 5 ++- .../include/GMUGeometryRenderer.m | 5 ++- .../include/GMUHeatmapTileLayer.m | 5 ++- .../GoogleMapsUtilsObjC/include/GMUVersion.h | 39 +++++++++++++++++++ .../GoogleMapsUtilsObjC/include/GMUVersion.m | 22 +++++++++++ .../include/GQTPointQuadTree.m | 4 ++ release-please-config.json | 3 +- samples/ObjCDemoApp/ObjCDemoApp/AppDelegate.m | 4 +- .../SwiftDemoApp/AppDelegate.swift | 4 +- 9 files changed, 85 insertions(+), 6 deletions(-) create mode 100644 Sources/GoogleMapsUtilsObjC/include/GMUVersion.h create mode 100644 Sources/GoogleMapsUtilsObjC/include/GMUVersion.m diff --git a/Sources/GoogleMapsUtilsObjC/include/GMUClusterManager.m b/Sources/GoogleMapsUtilsObjC/include/GMUClusterManager.m index 8232d7c8..d4696726 100644 --- a/Sources/GoogleMapsUtilsObjC/include/GMUClusterManager.m +++ b/Sources/GoogleMapsUtilsObjC/include/GMUClusterManager.m @@ -14,9 +14,10 @@ */ #import "GMUClusterManager+Testing.h" - +#import #import "GMUClusterRenderer.h" #import "GMUSimpleClusterAlgorithm.h" +#import "GMUVersion.h" static NSString *const kGMUCameraKeyPath = @"camera"; @@ -42,6 +43,8 @@ - (instancetype)initWithMap:(GMSMapView *)mapView algorithm:(id)algorithm renderer:(id)renderer { if ((self = [super init])) { + NSString *attributionID = [NSString stringWithFormat:@"gmp_git_iosmapsutils_v%@_cluster", GMU_VERSION]; + [GMSServices addInternalUsageAttributionID:attributionID]; _algorithm = [[GMUSimpleClusterAlgorithm alloc] init]; _mapView = mapView; _previousCamera = _mapView.camera; diff --git a/Sources/GoogleMapsUtilsObjC/include/GMUGeometryRenderer.m b/Sources/GoogleMapsUtilsObjC/include/GMUGeometryRenderer.m index 40032880..53c33fb7 100644 --- a/Sources/GoogleMapsUtilsObjC/include/GMUGeometryRenderer.m +++ b/Sources/GoogleMapsUtilsObjC/include/GMUGeometryRenderer.m @@ -14,7 +14,7 @@ */ #import "GMUGeometryRenderer.h" - +#import #import "GMUFeature.h" #import "GMUGeometryCollection.h" #import "GMUGroundOverlay.h" @@ -23,6 +23,7 @@ #import "GMUPoint.h" #import "GMUPolygon.h" #import "GMUStyle.h" +#import "GMUVersion.h" static NSString *const kStyleMapDefaultState = @"normal"; @@ -76,6 +77,8 @@ - (instancetype)initWithMap:(GMSMapView *)map styles:(NSArray *)styles styleMaps:(NSArray *)styleMaps { if (self = [super init]) { + NSString *attributionID = [NSString stringWithFormat:@"gmp_git_iosmapsutils_v%@_geometry", GMU_VERSION]; + [GMSServices addInternalUsageAttributionID:attributionID]; _map = map; _geometryContainers = geometries; _styles = [[self class] stylesDictionaryFromArray:styles]; diff --git a/Sources/GoogleMapsUtilsObjC/include/GMUHeatmapTileLayer.m b/Sources/GoogleMapsUtilsObjC/include/GMUHeatmapTileLayer.m index 4e82f05b..21e9374d 100644 --- a/Sources/GoogleMapsUtilsObjC/include/GMUHeatmapTileLayer.m +++ b/Sources/GoogleMapsUtilsObjC/include/GMUHeatmapTileLayer.m @@ -18,9 +18,10 @@ #endif #import "GMUHeatmapTileLayer.h" - +#import #import "GQTBounds.h" #import "GQTPointQuadTree.h" +#import "GMUVersion.h" static const int kGMUTileSize = 512; static const int kGMUMaxZoom = 22; @@ -51,6 +52,8 @@ @implementation GMUHeatmapTileLayer { - (instancetype)init { if ((self = [super init])) { + NSString *attributionID = [NSString stringWithFormat:@"gmp_git_iosmapsutils_v%@_heatmap", GMU_VERSION]; + [GMSServices addInternalUsageAttributionID:attributionID]; _radius = 20; _minimumZoomIntensity = 5; _maximumZoomIntensity = 10; diff --git a/Sources/GoogleMapsUtilsObjC/include/GMUVersion.h b/Sources/GoogleMapsUtilsObjC/include/GMUVersion.h new file mode 100644 index 00000000..ec170930 --- /dev/null +++ b/Sources/GoogleMapsUtilsObjC/include/GMUVersion.h @@ -0,0 +1,39 @@ +/* Copyright (c) 2025 Google Inc. + * + * 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 + * + * http://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 + +NS_ASSUME_NONNULL_BEGIN + +/** + * Google Maps iOS Utils library version. + * This version string is used for internal usage attribution. + */ +#define GMU_VERSION @"6.1.3" // x-release-please-version + +/** + * Google Maps iOS Utils library version as NSString constant. + * Accessible from both Objective-C and Swift code. + */ +extern NSString *const GMUVersionString; + +/** + * Returns the current Google Maps iOS Utils library version. + * Convenient function for Swift code to get the version string. + */ +NSString *GMUCurrentVersion(void); + +NS_ASSUME_NONNULL_END + diff --git a/Sources/GoogleMapsUtilsObjC/include/GMUVersion.m b/Sources/GoogleMapsUtilsObjC/include/GMUVersion.m new file mode 100644 index 00000000..b29209a8 --- /dev/null +++ b/Sources/GoogleMapsUtilsObjC/include/GMUVersion.m @@ -0,0 +1,22 @@ +/* Copyright (c) 2025 Google Inc. + * + * 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 + * + * http://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 "GMUVersion.h" + +NSString *const GMUVersionString = GMU_VERSION; + +NSString *GMUCurrentVersion(void) { + return GMU_VERSION; +} \ No newline at end of file diff --git a/Sources/GoogleMapsUtilsObjC/include/GQTPointQuadTree.m b/Sources/GoogleMapsUtilsObjC/include/GQTPointQuadTree.m index 3c72b37c..a4681d81 100644 --- a/Sources/GoogleMapsUtilsObjC/include/GQTPointQuadTree.m +++ b/Sources/GoogleMapsUtilsObjC/include/GQTPointQuadTree.m @@ -19,6 +19,8 @@ #import "GQTPointQuadTree.h" #import "GQTPointQuadTreeChild.h" +#import +#import "GMUVersion.h" @implementation GQTPointQuadTree { /** @@ -39,6 +41,8 @@ @implementation GQTPointQuadTree { - (id)initWithBounds:(GQTBounds)bounds { if (self = [super init]) { + NSString *attributionID = [NSString stringWithFormat:@"gmp_git_iosmapsutils_v%@_quadtree", GMU_VERSION]; + [GMSServices addInternalUsageAttributionID:attributionID]; bounds_ = bounds; [self clear]; } diff --git a/release-please-config.json b/release-please-config.json index ee163512..7aee1316 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -11,7 +11,8 @@ "extra-files": [ "Google-Maps-iOS-Utils.podspec", "Podfile.template", - "README.md" + "README.md", + "Sources/GoogleMapsUtilsObjC/include/GMUVersion.h" ] } } diff --git a/samples/ObjCDemoApp/ObjCDemoApp/AppDelegate.m b/samples/ObjCDemoApp/ObjCDemoApp/AppDelegate.m index 089efe97..e5cb8f19 100644 --- a/samples/ObjCDemoApp/ObjCDemoApp/AppDelegate.m +++ b/samples/ObjCDemoApp/ObjCDemoApp/AppDelegate.m @@ -16,6 +16,7 @@ #import "AppDelegate.h" @import GoogleMaps; +@import GoogleMapsUtils; //#error Change this key to a valid key registered with the demo app bundle id. Then delete this line. static NSString *const kMapsAPIKey = @""; @@ -25,7 +26,8 @@ @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [GMSServices provideAPIKey:kMapsAPIKey]; - [GMSServices addInternalUsageAttributionID:@"gmp_git_iosmapsutils_v6.2.0"]; + NSString *attributionID = [NSString stringWithFormat:@"gmp_git_iosmapsutils_v%@", GMU_VERSION]; + [GMSServices addInternalUsageAttributionID:attributionID]; return YES; } diff --git a/samples/SwiftDemoApp/SwiftDemoApp/AppDelegate.swift b/samples/SwiftDemoApp/SwiftDemoApp/AppDelegate.swift index e5c1e4d1..05ef7278 100644 --- a/samples/SwiftDemoApp/SwiftDemoApp/AppDelegate.swift +++ b/samples/SwiftDemoApp/SwiftDemoApp/AppDelegate.swift @@ -14,6 +14,7 @@ */ import GoogleMaps +import GoogleMapsUtils import UIKit // Change this key to a valid key registered with the demo app bundle id. @@ -29,7 +30,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { fatalError("Please provide an API Key using mapsAPIKey") } GMSServices.provideAPIKey(mapsAPIKey) - GMSServices.addInternalUsageAttributionID("gmp_git_iosmapsutils_v6.2.0") + let attributionID = "gmp_git_iosmapsutils_v\(GMUCurrentVersion())" + GMSServices.addInternalUsageAttributionID(attributionID) let masterViewController = MasterViewController() let navigationController = UINavigationController(rootViewController: masterViewController) window?.rootViewController = navigationController From d0813f33c2a5ed1311d65c666358aadfacbf3b98 Mon Sep 17 00:00:00 2001 From: Subhodip Date: Tue, 20 Jan 2026 21:44:50 +0530 Subject: [PATCH 2/4] feat: add API-level usage attribution for component tracking. --- Sources/GoogleMapsUtilsObjC/include/GMUVersion.h | 2 +- Sources/GoogleMapsUtilsObjC/include/GMUVersion.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/GoogleMapsUtilsObjC/include/GMUVersion.h b/Sources/GoogleMapsUtilsObjC/include/GMUVersion.h index ec170930..6c829f31 100644 --- a/Sources/GoogleMapsUtilsObjC/include/GMUVersion.h +++ b/Sources/GoogleMapsUtilsObjC/include/GMUVersion.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2025 Google Inc. +/* Copyright (c) 2026 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/GoogleMapsUtilsObjC/include/GMUVersion.m b/Sources/GoogleMapsUtilsObjC/include/GMUVersion.m index b29209a8..535af63b 100644 --- a/Sources/GoogleMapsUtilsObjC/include/GMUVersion.m +++ b/Sources/GoogleMapsUtilsObjC/include/GMUVersion.m @@ -1,4 +1,4 @@ -/* Copyright (c) 2025 Google Inc. +/* Copyright (c) 2026 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 05da80a2c1c0a3c61521801dc36336d088f5b44b Mon Sep 17 00:00:00 2001 From: Subhodip Date: Tue, 20 Jan 2026 21:46:50 +0530 Subject: [PATCH 3/4] feat: Update release please version to 7.0.0 --- Sources/GoogleMapsUtilsObjC/include/GMUVersion.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/GoogleMapsUtilsObjC/include/GMUVersion.h b/Sources/GoogleMapsUtilsObjC/include/GMUVersion.h index 6c829f31..f203b007 100644 --- a/Sources/GoogleMapsUtilsObjC/include/GMUVersion.h +++ b/Sources/GoogleMapsUtilsObjC/include/GMUVersion.h @@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN * Google Maps iOS Utils library version. * This version string is used for internal usage attribution. */ -#define GMU_VERSION @"6.1.3" // x-release-please-version +#define GMU_VERSION @"7.0.0" // x-release-please-version /** * Google Maps iOS Utils library version as NSString constant. From d3c6b32d5f9a7f7192c85b0f9b3e3bb94e55e47c Mon Sep 17 00:00:00 2001 From: Subhodip Date: Wed, 21 Jan 2026 18:32:53 +0530 Subject: [PATCH 4/4] chore: Update iOS version for CI. --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c5997725..10b48022 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,13 +48,13 @@ jobs: run: | xcodebuild clean build analyze \ -scheme GoogleMapsUtils -configuration Debug \ - -destination "platform=iOS Simulator,OS=18.4,name=iPhone 16" \ + -destination "platform=iOS Simulator,OS=26.2,name=iPhone 17" \ -disableAutomaticPackageResolution | xcpretty - name: Run unit tests on Swift Package run: | xcodebuild test -scheme GoogleMapsUtils \ - -destination "platform=iOS Simulator,OS=18.4,name=iPhone 16" \ + -destination "platform=iOS Simulator,OS=26.2,name=iPhone 17" \ -disableAutomaticPackageResolution - name: Upload test results to CodeCov @@ -66,7 +66,7 @@ jobs: # - name: Build DevApp # run: | - # xcodebuild -scheme DevApp -configuration Debug -destination "platform=iOS Simulator,OS=16.2,name=iPhone 8" build | xcpretty + # xcodebuild -scheme DevApp -configuration Debug -destination "platform=iOS Simulator,OS=26.2,name=iPhone 17" build | xcpretty build_test_cocoapod: name: Build and test the CocoaPod spec @@ -108,7 +108,7 @@ jobs: run: | xcodebuild -workspace samples/SwiftDemoApp/SwiftDemoApp.xcworkspace \ -scheme SwiftDemoApp -configuration Debug \ - -destination "platform=iOS Simulator,OS=18.4,name=iPhone 16" build | xcpretty + -destination "platform=iOS Simulator,OS=26.2,name=iPhone 17" build | xcpretty build_objc_sample: name: Build Objective-C Sample App with CocoaPods locally @@ -129,7 +129,7 @@ jobs: run: | xcodebuild -workspace samples/ObjCDemoApp/ObjCDemoApp.xcworkspace \ -scheme ObjCDemoApp -configuration Debug \ - -destination "platform=iOS Simulator,OS=18.4,name=iPhone 16" build | xcpretty + -destination "platform=iOS Simulator,OS=26.2,name=iPhone 17" build | xcpretty test: # used as required status check runs-on: ubuntu-latest