Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/google_sign_in/google_sign_in_ios/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 6.3.0

* Add UIScene compatibility.
* Updates minimum supported SDK version to Flutter 3.38/Dart 3.10.
## 6.2.5

* Updates native header visibility for Swift testing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ static FSIGoogleSignInErrorCode FSIPigeonErrorCodeForGIDSignInErrorCode(NSIntege
#pragma mark -

@interface FLTGoogleSignInPlugin ()
#if TARGET_OS_IOS
<FlutterSceneLifeCycleDelegate>
#endif

// The contents of GoogleService-Info.plist, if it exists.
@property(nonatomic, nullable) NSDictionary<NSString *, id> *googleServiceProperties;
Expand All @@ -115,6 +118,9 @@ + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar {
FLTGoogleSignInPlugin *instance = [[FLTGoogleSignInPlugin alloc]
initWithViewProvider:[[FSIDefaultViewProvider alloc] initWithRegistrar:registrar]];
[registrar addApplicationDelegate:instance];
#if TARGET_OS_IOS
[registrar addSceneDelegate:instance];
#endif
SetUpFSIGoogleSignInApi(registrar.messenger, instance);
}

Expand Down Expand Up @@ -149,6 +155,14 @@ - (instancetype)initWithSignIn:(NSObject<FSIGIDSignIn> *)signIn
#pragma mark - <FlutterPlugin> protocol

#if TARGET_OS_IOS

- (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts {
for (UIOpenURLContext *context in URLContexts) {
NSURL *url = context.URL;
[self.signIn handleURL:url];
}
}

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options {
return [self.signIn handleURL:url];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ - (UIViewController *)viewController {
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
// TODO(stuartmorgan) Provide a non-deprecated codepath. See
// https://github.com/flutter/flutter/issues/104117
#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

return UIApplication.sharedApplication.keyWindow.rootViewController;
#pragma clang diagnostic pop
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
#import <Flutter/Flutter.h>
#import <UIKit/UIKit.h>

@interface AppDelegate : FlutterAppDelegate
@interface AppDelegate : FlutterAppDelegate <FlutterImplicitEngineDelegate>

@end
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ @implementation AppDelegate

- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GeneratedPluginRegistrant registerWithRegistry:self];
// Override point for customization after application launch.
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}

- (void)didInitializeImplicitFlutterEngine:(NSObject<FlutterImplicitEngineBridge> *)engineBridge {
[GeneratedPluginRegistrant registerWithRegistry:engineBridge.pluginRegistry];
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,26 @@
<string>479882132969-9i9aqik3jfjd7qhci1nqf0bm2g71rm1u.apps.googleusercontent.com</string>
<key>GIDServerClientID</key>
<string>YOUR_SERVER_CLIENT_ID</string>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneClassName</key>
<string>UIWindowScene</string>
<key>UISceneDelegateClassName</key>
<string>FlutterSceneDelegate</string>
<key>UISceneConfigurationName</key>
<string>flutter</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ description: Example of Google Sign-In plugin.
publish_to: none

environment:
sdk: ^3.9.0
flutter: ">=3.35.0"
sdk: ^3.10.0
flutter: ">=3.38.0"

dependencies:
flutter:
Expand Down
6 changes: 3 additions & 3 deletions packages/google_sign_in/google_sign_in_ios/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: google_sign_in_ios
description: iOS implementation of the google_sign_in plugin.
repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_ios
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22
version: 6.2.5
version: 6.3.0

environment:
sdk: ^3.9.0
flutter: ">=3.35.0"
sdk: ^3.10.0
flutter: ">=3.38.0"

flutter:
plugin:
Expand Down
Loading