-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[google_maps_flutter] Restructure iOS to prep for SwiftPM #10839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
auto-submit
merged 17 commits into
flutter:main
from
stuartmorgan-g:maps-ios-pre-spm-restructuring
Jan 21, 2026
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
67c7143
Add a placeholder directory for the new shared code.
stuartmorgan-g 2fa9532
Switch to SwiftPM structure, and remove modulemap, for future compat
stuartmorgan-g 88be520
Add an initial version of the shared code validator.
stuartmorgan-g 290e5b4
Update the copy to use a different messages name instead of relative …
stuartmorgan-g 0e931a8
Update the shared source to use a different messages name instead of …
stuartmorgan-g 61b0709
Initial version of a synchronization command
stuartmorgan-g 275d167
Report unshared files for auditing
stuartmorgan-g c9e2f98
Replace deprecated code
stuartmorgan-g 9e79de1
Remove duplicate examples
stuartmorgan-g 859c243
Collapse back to a single example app
stuartmorgan-g c0c7018
Add code from example to shared code
stuartmorgan-g 74c8692
Switch example app to Swift
stuartmorgan-g 16b5138
Switch shared code to Swift
stuartmorgan-g 88c3184
Tool fixes/improvements
stuartmorgan-g 8e7febf
Remove shared code handling
stuartmorgan-g b552373
Version bump
stuartmorgan-g 1a662bb
Revert the tool dev dependencies
stuartmorgan-g File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 9 additions & 42 deletions
51
packages/google_maps_flutter/google_maps_flutter_ios/example/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,46 +1,13 @@ | ||
| # Platform Implementation Test Apps | ||
| # Platform Implementation Test App | ||
|
|
||
| These are test apps for manual testing and automated integration testing | ||
| of this platform implementation. They are not intended to demonstrate actual | ||
| use of this package, since the intent is that plugin clients use the | ||
| app-facing package. | ||
| This is a test app for manual testing and automated integration testing | ||
| of this platform implementation. It is not intended to demonstrate actual use of | ||
| this package, since the intent is that plugin clients use the app-facing | ||
| package. | ||
|
|
||
| Unless you are making changes to this implementation package, these examples | ||
| are very unlikely to be relevant. | ||
| Unless you are making changes to this implementation package, this example is | ||
| very unlikely to be relevant. | ||
|
|
||
| ## Structure | ||
| ## Versions | ||
|
|
||
| This package contains multiple exmaples, which are used to test different | ||
| versions of the Google Maps iOS SDK. Because the plugin's dependency | ||
| is loosely pinned, CocoaPods will pick the newest version that supports the | ||
| minimum targetted OS version of the application using the plugin. In | ||
| order to ensure that the plugin continues to compile against all | ||
| SDK versions that could resolve, there are multiple largely identical | ||
| examples, each with a different minimum target iOS version. | ||
|
|
||
| In order to avoid wasting CI resources, tests are mostly not duplicated. | ||
| The test structure is: | ||
| * The oldest version has all of the usual tests (Dart integration, | ||
| XCTest, XCUITest). | ||
| * The newest version has only XCTests (the cheapest tests), which | ||
| can be used to unit tests any code paths that are specific to | ||
| new SDKs (e.g., behind target OS `#if` checks). | ||
|
|
||
| This setup is based on the assumption (based on experience so far) that | ||
| the changes in the SDK are unlikely to break functionality at runtime, | ||
| but that we will want to have unit test coverage of new-SDK-only code. | ||
| New test types can be added to any example if needs change. | ||
|
|
||
| ## Updating Examples | ||
|
|
||
| * When a new major of the SDK comes out that raises the minimum | ||
| iOS deployment version, a new example with that minimum target | ||
| should be added to ensure that the plugin compiles with that | ||
| version of the SDK, and the range in the plugin's `podspec` file | ||
| should be bumped to the next major version. | ||
| * When the minimum supported version of Flutter (on `stable`) | ||
| reaches the point where the oldest example is for an SDK | ||
| that can no longer be resolved to, that example should be | ||
| removed, and all of its testing (Dart integration tests, | ||
| native unit tests, native UI tests) should be folded into | ||
| the next-oldest version. | ||
| This example requires iOS 14, so will select a 8.x GoogleMaps SDK version. |
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions
21
packages/google_maps_flutter/google_maps_flutter_ios/example/ios/Runner/AppDelegate.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| // Copyright 2013 The Flutter Authors | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import Flutter | ||
| import GoogleMaps | ||
| import UIKit | ||
|
|
||
| @main | ||
| @objc class AppDelegate: FlutterAppDelegate { | ||
| override func application( | ||
| _ application: UIApplication, | ||
| didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? | ||
| ) -> Bool { | ||
| var mapsApiKey = ProcessInfo.processInfo.environment["MAPS_API_KEY"] ?? "YOUR KEY HERE" | ||
| GMSServices.provideAPIKey(mapsApiKey) | ||
|
|
||
| GeneratedPluginRegistrant.register(with: self) | ||
| return super.application(application, didFinishLaunchingWithOptions: launchOptions) | ||
| } | ||
| } | ||
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a new file; git is just confused because the file is so short that the license block is most of it, so it looks falls into the rename detection threshold. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this checks for an empty string, only that it's not nil. Original checks for empty string
packages/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/AppDelegate.m
Lines 16 to 18 in 67f4678
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really worried about preserving the specific behavior there; in practice I don't think the environment variable codepath is probably useful anyway since generally device environment isn't going to be inherited from anywhere helpful. Maybe it once worked in CI for simulators, but we haven't had CI set up to use keys in a very long time.
I have an open issue for getting keys working (again?) for this package in CI, and if/when we get to that we can revisit this code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if someone both hard-codes their key into the example locally, and then also explicitly sets the environment variable, but sets it to an empty string, and they break their local testing that way... 🤷🏻