1

我需要在我的应用程序中添加一个功能,我可以检查我的 iPhone/iPad 上是否已经安装了 Linked In 和 Google+ 应用程序,然后通过它对用户进行身份验证。我在 Facebook 和 Twitter 上做得很成功。需要有关 Linked-In 和 Google Plus 的帮助。问候 !

4

1 回答 1

4

GPPSignIn类使用 Google 登录用户。

它通过 Google+ 应用(如果已安装)、Chrome for iOS(如果已安装)或 Mobile Safari 提供单点登录。

如需参考,请参阅https://developers.google.com/+/mobile/ios/sign-in上的“iOS 版 Google+ 登录” 。以下是使用 GPPSignIn 的示例代码:

Get a reference to the GPPSignIn shared instance: GPPSignIn *signIn = [GPPSignIn sharedInstance];
Set the OAuth 2.0 scopes you want to request: [signIn setScopes:[NSArray arrayWithObject: "https://www.googleapis.com/auth/plus.login"]];
Call [signIn setDelegate:self];
Set up delegate method finishedWithAuth:error:.
Call handleURL on the shared instance from application:openUrl:... in your app delegate.
Call [signIn authenticate];

请参考文档https://developers.google.com/+/mobile/ios/api/interface_g_p_p_sign_in

另请参阅此链接Google Plus API GPPSignIn 错误代码“不匹配的身份验证”

于 2013-09-05T10:05:47.510 回答