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
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 4 additions & 1 deletion Sources/GoogleMapsUtilsObjC/include/GMUClusterManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
*/

#import "GMUClusterManager+Testing.h"

#import <GoogleMaps/GoogleMaps.h>
#import "GMUClusterRenderer.h"
#import "GMUSimpleClusterAlgorithm.h"
#import "GMUVersion.h"

static NSString *const kGMUCameraKeyPath = @"camera";

Expand All @@ -42,6 +43,8 @@ - (instancetype)initWithMap:(GMSMapView *)mapView
algorithm:(id<GMUClusterAlgorithm>)algorithm
renderer:(id<GMUClusterRenderer>)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;
Expand Down
5 changes: 4 additions & 1 deletion Sources/GoogleMapsUtilsObjC/include/GMUGeometryRenderer.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/

#import "GMUGeometryRenderer.h"

#import <GoogleMaps/GoogleMaps.h>
#import "GMUFeature.h"
#import "GMUGeometryCollection.h"
#import "GMUGroundOverlay.h"
Expand All @@ -23,6 +23,7 @@
#import "GMUPoint.h"
#import "GMUPolygon.h"
#import "GMUStyle.h"
#import "GMUVersion.h"

static NSString *const kStyleMapDefaultState = @"normal";

Expand Down Expand Up @@ -76,6 +77,8 @@ - (instancetype)initWithMap:(GMSMapView *)map
styles:(NSArray<GMUStyle *> *)styles
styleMaps:(NSArray<GMUStyleMap *> *)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];
Expand Down
5 changes: 4 additions & 1 deletion Sources/GoogleMapsUtilsObjC/include/GMUHeatmapTileLayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
#endif

#import "GMUHeatmapTileLayer.h"

#import <GoogleMaps/GoogleMaps.h>
#import "GQTBounds.h"
#import "GQTPointQuadTree.h"
#import "GMUVersion.h"

static const int kGMUTileSize = 512;
static const int kGMUMaxZoom = 22;
Expand Down Expand Up @@ -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;
Expand Down
39 changes: 39 additions & 0 deletions Sources/GoogleMapsUtilsObjC/include/GMUVersion.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/* 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.
* 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 <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

/**
* Google Maps iOS Utils library version.
* This version string is used for internal usage attribution.
*/
#define GMU_VERSION @"7.0.0" // 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

22 changes: 22 additions & 0 deletions Sources/GoogleMapsUtilsObjC/include/GMUVersion.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* 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.
* 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;
}
4 changes: 4 additions & 0 deletions Sources/GoogleMapsUtilsObjC/include/GQTPointQuadTree.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

#import "GQTPointQuadTree.h"
#import "GQTPointQuadTreeChild.h"
#import <GoogleMaps/GoogleMaps.h>
#import "GMUVersion.h"

@implementation GQTPointQuadTree {
/**
Expand All @@ -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];
}
Expand Down
3 changes: 2 additions & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"extra-files": [
"Google-Maps-iOS-Utils.podspec",
"Podfile.template",
"README.md"
"README.md",
"Sources/GoogleMapsUtilsObjC/include/GMUVersion.h"
]
}
}
Expand Down
4 changes: 3 additions & 1 deletion samples/ObjCDemoApp/ObjCDemoApp/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 = @"";
Expand All @@ -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;
}

Expand Down
4 changes: 3 additions & 1 deletion samples/SwiftDemoApp/SwiftDemoApp/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/

import GoogleMaps
import GoogleMapsUtils
import UIKit

// Change this key to a valid key registered with the demo app bundle id.
Expand All @@ -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
Expand Down
Loading