[google_sign_in_ios][UIScene] Migrate to UIScene#10960
[google_sign_in_ios][UIScene] Migrate to UIScene#10960LouiseHsu wants to merge 15 commits intoflutter:mainfrom
Conversation
| } | ||
| } | ||
| } | ||
| }; |
There was a problem hiding this comment.
Drive-by note: we don't actually want to replicate the old logic's behavior identically. That was a pattern we used in plugins because until recently we had no way to get the Flutter view itself, or its controller, so we guessed that it was the key window's root view controller.
The thing we actually want is just the new registrar.viewController API.
There was a problem hiding this comment.
Code Review
This pull request successfully migrates the google_sign_in_ios plugin and its example application to support UIScene on iOS. Key changes include implementing FlutterSceneLifeCycleDelegate and handling UIScene URL contexts in the plugin's Objective-C code, updating the example app's AppDelegate for implicit Flutter engine initialization, and configuring Info.plist for UIScene support. The minimum supported SDK versions for Flutter and Dart have also been updated, and associated Xcode project files have been adjusted.
| #if TARGET_OS_IOS | ||
| return self.registrar.viewController; | ||
| #endif |
There was a problem hiding this comment.
The change introduces return self.registrar.viewController; which is likely the intended non-deprecated codepath. If this fully addresses the TODO, consider removing or updating the TODO comment to reflect the current status. If self.registrar.viewController is still considered deprecated or a temporary solution, the comment should clarify that.
There was a problem hiding this comment.
Yep, all the pragmas can go. Also, since we only support iOS and macOS we traditionally just use #if/#else for iOS/macOS divergence, and this is already the #else that's for iOS so you don't need the inner #if.
This can just become:
#else
- (UIViewController *)viewController {
return self.registrar.viewController;
}
#endif| 2DDAAC64C5C0B7BB335007CB /* libPods-RunnerTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FA388E7A8C561BE2343D6D97 /* libPods-RunnerTests.a */; }; | ||
| 5C6F5A6E1EC3B4CB008D64B5 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C6F5A6D1EC3B4CB008D64B5 /* GeneratedPluginRegistrant.m */; }; | ||
| 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; | ||
| 78A36DA12AF5761E00CBFD43 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7A303C2D1E89D76400B1F19E /* GoogleService-Info.plist */; }; | ||
| 7A534F8C5E1988E40A95718E /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 997F740A65A2CA90D21D7589 /* libPods-Runner.a */; }; | ||
| 7ACDFB0E1E8944C400BE2D00 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7ACDFB0D1E8944C400BE2D00 /* AppFrameworkInfo.plist */; }; | ||
| 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; | ||
| 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; |
There was a problem hiding this comment.
The project.pbxproj file has numerous changes, including new UUIDs and reorganized references for Pods libraries and build configurations. These are often auto-generated by Xcode or pod install. Please confirm that these changes are intentional and correctly reflect the updated project structure after the SDK and CocoaPods updates.
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="24412" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> | ||
| <device id="retina6_12" orientation="portrait" appearance="light"/> | ||
| <dependencies> | ||
| <deployment identifier="iOS"/> | ||
| <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> | ||
| <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24405"/> | ||
| <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
| </dependencies> |
There was a problem hiding this comment.
The LaunchScreen.storyboard file shows updates to toolsVersion, targetRuntime, and the addition of device and capability tags. These are typically auto-generated when opening and saving the project in a newer Xcode version. Please confirm these changes are expected and do not introduce any unintended layout or configuration issues.
| #if TARGET_OS_IOS | ||
| return self.registrar.viewController; | ||
| #endif |
There was a problem hiding this comment.
Yep, all the pragmas can go. Also, since we only support iOS and macOS we traditionally just use #if/#else for iOS/macOS divergence, and this is already the #else that's for iOS so you don't need the inner #if.
This can just become:
#else
- (UIViewController *)viewController {
return self.registrar.viewController;
}
#endif| @@ -1,3 +1,7 @@ | |||
| ## 6.3.0 | |||
|
|
|||
| * Add UIScene compatibility. | |||
Addresses flutter/flutter#174412
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].///).