Skip to content

[google_sign_in_ios][UIScene] Migrate to UIScene#10960

Open
LouiseHsu wants to merge 15 commits intoflutter:mainfrom
LouiseHsu:google_sign_in_ui_scene
Open

[google_sign_in_ios][UIScene] Migrate to UIScene#10960
LouiseHsu wants to merge 15 commits intoflutter:mainfrom
LouiseHsu:google_sign_in_ui_scene

Conversation

@LouiseHsu
Copy link
Contributor

@LouiseHsu LouiseHsu commented Feb 4, 2026

Addresses flutter/flutter#174412

Pre-Review Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] page, which explains my responsibilities.
  • I read and followed the [relevant style guides] and ran [the auto-formatter].
  • I signed the [CLA].
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I [linked to at least one issue that this PR fixes] in the description above.
  • I updated pubspec.yaml with 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].
  • I updated CHANGELOG.md to 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].
  • I updated/added any relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or I have commented below to indicate which [test exemption] this PR falls under[^1].
  • All existing and new tests are passing.

}
}
}
};
Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g Feb 4, 2026

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oooh, gotcha!

@LouiseHsu LouiseHsu changed the title Google sign in UI scene [google_sign_in_ios][UIScene] Migrate to UIScene Feb 4, 2026
@LouiseHsu LouiseHsu marked this pull request as ready for review February 4, 2026 21:25
Copy link

@gemini-code-assist gemini-code-assist bot left a 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 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.

Comment on lines 31 to 33
#if TARGET_OS_IOS
return self.registrar.viewController;
#endif

Choose a reason for hiding this comment

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

medium

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.

Copy link
Collaborator

Choose a reason for hiding this comment

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

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

Comment on lines 10 to 17
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 */; };

Choose a reason for hiding this comment

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

medium

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.

Comment on lines 1 to 8
<?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>

Choose a reason for hiding this comment

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

medium

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

my bad bud

Comment on lines 31 to 33
#if TARGET_OS_IOS
return self.registrar.viewController;
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

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

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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: Adds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants