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

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

本文介绍了iOS Google登录视图缺少导航栏和底部栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

@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

基本上,GIDSignIn位于我的GooglePlusManager中,并且我将当前的SignIN ViewController传递给了GooglePlusManager,一切正常,除了登录"页面没有后退按钮/取消按钮.我已经尝试将setUiDelegate设置为self或VC,结果是相同的.发生在实际的9.0设备和9.1仿真器中.

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. I have tried setUiDelegate to self or VC, the result is same.occurs in real 9.0 device and 9.1 simulator.

推荐答案

弄清楚答案是我错过了SafariServices.framework.将SafariServices.framework链接到应用程序后,它可以正常工作.

Figure out the answer is I missed SafariServices.framework. After I linked SafariServices.framework to the app, its working properly.

这篇关于iOS Google登录视图缺少导航栏和底部栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 12:04