-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[google_maps_flutter_ios] Migrate to UIScene #11001
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
base: main
Are you sure you want to change the base?
Conversation
…es into google-maps-ios-uiscene
| return super.application(application, didFinishLaunchingWithOptions: launchOptions) | ||
| } | ||
|
|
||
| nonisolated func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { |
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 had to add "nonisolated" to get rid of
/Volumes/Work/s/w/ir/x/w/packages/packages/google_maps_flutter/google_maps_flutter_ios/example/ios/Runner/AppDelegate.swift:20:7
Not sure if related to flutter/flutter#181033
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.
The error message doesn't seem to be complete.
The FlutterImplicitEngineDelegate protocol should be main actor isolated, so this method shouldn't be nonisolated (as the caller guarantees it will be called on the main queue).
Since this is an example app, maybe turn off concurrency checking for now? Change the flag specified here to minimal: https://www.swift.org/documentation/concurrency/
You can also do an isolated conformance but I suspect when we properly mark FlutterImplicitEngineBridge as main actor isolated it will be source breaking again.
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.
oopsies.
the error was
Main actor-isolated instance method 'didInitializeImplicitFlutterEngine' cannot be used to satisfy nonisolated protocol requirement
/Volumes/Work/s/w/ir/x/w/packages/packages/google_maps_flutter/google_maps_flutter_ios/example/ios/Runner/AppDelegate.swift:20:7
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 agree with @LongCatIsLooong, let's turn off concurrency check for now
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.
Looks like you can do it with an Xcode build setting: https://www.swift.org/documentation/concurrency/#using-xcode
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 did try adding the build setting but same error 👀 any other options?
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.
As discussed from the triage meeting - the concurrency check setting is Swift 5 only, and is an intermediate measure for people to incrementally adopt Swift 6. Since our engine API is not Swift 6 friendly yet, we should revert back to Swift 5.
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.
Code Review
This pull request migrates the google_maps_flutter_ios package to be compatible with UIScene, which is the modern approach for managing UI lifecycle on iOS. The changes include updating the AppDelegate to handle implicit engine initialization, replacing the deprecated [UIScreen mainScreen] API, and updating the example app's Info.plist to declare scene support. The changes look good, but I've found an indentation issue in the Info.plist file that should be corrected.
packages/google_maps_flutter/google_maps_flutter_ios/example/ios/Runner/Info.plist
Outdated
Show resolved
Hide resolved
| image = [assetProvider imageNamed:[assetProvider lookupKeyForAsset:bitmapAssetImage.name]]; | ||
| image = scaledImage(image, bitmapAssetImage.scale); | ||
| } else if ([bitmap isKindOfClass:[FGMPlatformBitmapBytes class]]) { | ||
| // Deprecated: This message handling for 'fromBytes' has been replaced by 'bytes'. |
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.
this code path is deprecated anyways, plus the screenScale is already nicely passed in
|
i screwed up the merge lol one sec |
Fixes flutter/flutter#174413
Pre-Review Checklist
[shared_preferences]pubspec.yamlwith an appropriate new version according to the [pub versioning philosophy], or I have commented below to indicate which [version change exemption] this PR falls under[^1].CHANGELOG.mdto add a description of the change, [following repository CHANGELOG style], or I have commented below to indicate which [CHANGELOG exemption] this PR falls under[^1].///).