Skip to content

Add flag to exclude Google Maps SDK in iOS - #93

Merged
lodev09 merged 4 commits into
lugg:mainfrom
jakobjohansson:main
Sep 12, 2026
Merged

lodev09 merged 4 commits into
lugg:mainfrom
jakobjohansson:main

Conversation

@jakobjohansson

Copy link
Copy Markdown
Contributor

Summary

Add $LuggMapsGoogleEnabled Podfile flag to opt out of the Google Maps iOS SDK. Apps that only use provider="apple" currently still link GoogleMaps.xcframework (~36 MB arm64 slice, ~10 MB shipped). Setting $LuggMapsGoogleEnabled = false before pod install drops the dependency and excludes the Google provider sources; LuggMapView.mm guards the Google branches with __has_include and falls back to Apple Maps with a warning if provider="google" is requested anyway. Default behaviour is unchanged.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Test Plan

pod install with the flag set in a bare RN 0.86 / Expo 57 app: GoogleMaps removed from Podfile.lock, project compiles and Apple Maps renders. Without the flag: unchanged lock file.

Screenshots / Videos

N/A

Checklist

  • I tested on iOS
  • I tested on Android
  • I tested on Web
  • I updated the documentation (if needed)

@vercel

vercel Bot commented Sep 11, 2026

Copy link
Copy Markdown

@jakobjohansson is attempting to deploy a commit to the lodev09 Team on Vercel.

A member of the Team first needs to authorize it.

@lodev09 lodev09 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @jakobjohansson. Can we also add this to our expo config plugin for apps built with expo?

@jakobjohansson

Copy link
Copy Markdown
Contributor Author

Thanks @jakobjohansson. Can we also add this to our expo config plugin for apps built with expo?

Sure 👍 Should be working now

@lodev09

lodev09 commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Pushed two commits on top:

fix: handle iOS Google Maps exclusion consistently

  • Podspec now defines LUGG_GOOGLE_MAPS_ENABLED via pod_target_xcconfig instead of relying on __has_include — the Google sources are excluded from the pod, so the header check was ambiguous across build setups.
  • reload checks [_provider isKindOfClass:[AppleMapProvider class]] instead of _providerType, so the Apple fallback also gets the inset-corrected camera move.
  • Plugin: googleEnabled: false now also strips GMSApiKey from Info.plist and removes import GoogleMaps / GMSServices.provideAPIKey(...) from AppDelegate.swift, so toggling back and forth is idempotent.
  • Added plugin/__tests__/withLuggMapsIOS.test.ts covering default, fresh disable, disable/re-enable of an existing project, and repeat runs.

chore: log when iOS Google Maps SDK is disabled

  • pod install and expo prebuild print [LuggMaps] Google Maps SDK is disabled, Apple Maps only. so it is obvious the SDK was dropped.

Verified on example/expo with iosGoogleMapsEnabled: false and expo prebuild --clean: no GoogleMaps in Podfile.lock, no GMSApiKey, clean AppDelegate.swift, Apple Maps renders.

Heads up: the PR description still mentions __has_include — worth updating. Thanks @jakobjohansson!

@vercel

vercel Bot commented Sep 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
lugg-maps Ready Ready Preview Sep 12, 2026 12:26am UTC

Request Review

@lodev09
lodev09 merged commit e5f7353 into lugg:main Sep 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants