简体   繁体   English

iOS Google登录视图缺少导航栏和底部栏

[英]iOS Google SignIn view missing navigation bar and bottom bar

@interface GooglePlusManager() <GIDSignInDelegate,GIDSignInUIDelegate>

@property (nonatomic, strong) GIDSignIn *gppSignIn;
@property (nonatomic, weak) UIViewController * localVC;
@end

@implementation TWNGooglePlusManager

(void)doGooglePlusLogin: (UIViewController *)viewController
{
    [self setPropertiesToInitialState];

NSString* clientId = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"GoogleClientId"];
self.gppSignIn = [GIDSignIn sharedInstance];

[self.gppSignIn setClientID:clientId];

if (self.gppSignIn)
{
    self.gppSignIn.scopes =  @[ @"profile", @"email" ];

    [self.gppSignIn setDelegate:self];
    self.localVC = viewController;
    [self.gppSignIn setUiDelegate:self];
    self.gppSignIn.allowsSignInWithWebView = YES;
    [self.gppSignIn signIn];

}
}

#pragma mark - GIDSignInUiDelegate
 (void)signIn:(GIDSignIn *)signIn presentViewController:(UIViewController     *)viewController {

[self.localVC presentViewController:viewController animated:YES completion:nil];

}
@end

Basically, GIDSignIn is in my GooglePlusManager, and I passed current SignIN ViewController to GooglePlusManager, everything is working fine, except the Login page doesnt have backbutton/cancel button. 基本上,GIDSignIn位于我的GooglePlusManager中,并且我将当前的SignIN ViewController传递给了GooglePlusManager,一切正常,除了“登录”页面没有后退按钮/取消按钮。 I have tried setUiDelegate to self or VC, the result is same. 我已经尝试将setUiDelegate设置为self或VC,结果是相同的。 occurs in real 9.0 device and 9.1 simulator. 发生在实际的9.0设备和9.1仿真器中。

在此处输入图片说明

Figure out the answer is I missed SafariServices.framework. 找出答案就是我错过了SafariServices.framework。 After I linked SafariServices.framework to the app, its working properly. 将SafariServices.framework链接到应用程序后,它可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM