Facebook登录和Google登录之间的冲突 - iOS [英] Conflict between Facebook Sign In and Google Sign In - iOS

查看:220
本文介绍了Facebook登录和Google登录之间的冲突 - iOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的应用程序中通过Facebook成功部署了登录。然后,我尝试添加通过Google+登录的可能性,但是我已经放弃了几个晚上的编码和几个人的帖子比我现在的路障结束时更加先进:我如何登录google-plus使用google-plus-ios-sdk-1.7.1 sdk?



我正在尝试实施Google登录遵循 Google开发人员网站的简单说明。



然而,由Google解释的方式与通过Facebook登录登录所需的设置产生了一些冲突。
我试图通过使用Pod来重写Facebook代码,并在安装Google登录的同时进行安装,但是我无法使其工作(仍然阻碍了通过Facebook的身份验证)。

解决方案c) - (BOOL)应用程序:(UIApplication *)应用程序
openURL :( NSURL *)url
sourceApplication:(NSString *)sourceApplication
注释:(id)注释{


if([[url scheme] isEqualToString:FBTOKEN]){
return [FBSession.activeSession handleOpenURL:url];

return [FBAppCall handleOpenURL:url
sourceApplication:sourceApplication
withSession:FBSession.activeSession];
}
else {
[GPPURLHandler handleURL:url sourceApplication:sourceApplication annotation:annotation];

}
return YES;
}


I've successfully deployed a Log In via Facebook in my app. I've then tried to add the possibility to log in via Google+ but I gave up after a few long nights of coding and a few posts from people much more advanced than I am concluding on the roadblocks existing at the moment example: How can I login to google-plus using google-plus-ios-sdk-1.7.1 sdk?.

I am now trying to implement a Google Sign In by following the seemingly easy instructions from the Google Developer site.

However the way this is explained by Google creates several conflicts with the set-up needed for running the Log In via Facebook. I have tried to rewrite the Facebook code by using a Pod and installing it at the same time I install the Google Sign In but I was not able to make it work (still something hindering the authentication via Facebook).

解决方案

Implement like this way.

- (BOOL)  application:(UIApplication *)application
              openURL:(NSURL *)url
    sourceApplication:(NSString *)sourceApplication
           annotation:(id)annotation {


    if ([[url scheme] isEqualToString:FBTOKEN]) {
        return [FBSession.activeSession handleOpenURL:url];

        return [FBAppCall handleOpenURL:url
                      sourceApplication:sourceApplication
                            withSession:FBSession.activeSession];
    }
    else { 
            [GPPURLHandler handleURL:url sourceApplication:sourceApplication annotation:annotation];

    }
  return YES;
}

这篇关于Facebook登录和Google登录之间的冲突 - iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆