如何使用现有的示例应用程序将谷歌凭证集成到iPhone应用程序中
我从下面的链接下载了 .zip 文件,其中包含一些示例。在其中我玩了 OAuthSampleTouch 应用程序。
http://code.google.com/p/gdata-objectivec-client/downloads/list
这是我下载的文件: gdata-objectivec-client-1.11.0.zip
我已经完成了它,但我很困惑如何传递电子邮件和密码输入,然后如何通过谷歌从我的 iPhone 应用程序进行连接。
新编辑的代码: 这是“OAuthSampleRootViewControllerTouch.m”类中 OAuthSampleTouch 示例的代码,请参阅 http该 OAuthSampleTouch 应用程序中的 ://code.google.com/p/gdata-objectivec-client/downloads/list。
- (void)signInToGoogle
{
[self signOut];
NSString *keychainAppServiceName = nil;
if ([self shouldSaveInKeychain])
{
keychainAppServiceName = kAppServiceName;
}
// For GData applications, the scope is available as
// NSString *scope = [[service class] authorizationScope];
NSString *scope = @"http://www.google.com/m8/feeds/";
// ### Important ###
// GDataOAuthViewControllerTouch is not designed to be reused. Make a new
// one each time you are going to show it.
// Display the autentication view.
GDataOAuthViewControllerTouch *viewController = [[[GDataOAuthViewControllerTouch alloc]
initWithScope:scope
language:nil
appServiceName:keychainAppServiceName
delegate:self
finishedSelector:@selector(viewController:finishedWithAuth:error:)] autorelease];
// You can set the title of the navigationItem of the controller here, if you want.
// Optional: display some html briefly before the sign-in page loads
NSString *html = @"<html><body bgcolor=silver><div align=center>Loading sign-in page...</div></body></html>";
[viewController setInitialHTMLString:html];
[[self navigationController] pushViewController:viewController animated:YES];
}
这是“OAuthSampleRootViewControllerTouch.m”类中 OAuthSampleTouch 示例的代码,请检查它。我需要传递凭据的范围是什么以及从哪里?如果我运行此命令,我将收到日志作为身份验证错误:
请帮助我,我从三天开始尝试。
非常感谢任何帮助。
谢谢你, 马丹·莫汉。
From the below link I download the .zip file it contains some example. In that I played the OAuthSampleTouch application.
http://code.google.com/p/gdata-objectivec-client/downloads/list
This is the file I downloaded :
gdata-objectivec-client-1.11.0.zip
I gone through it but I am getting confusion how to pass input that is email and password and then how to connect through google form my iphone app.
Newly edited code:
This is code from OAuthSampleTouch example in the class "OAuthSampleRootViewControllerTouch.m" Please refer http://code.google.com/p/gdata-objectivec-client/downloads/list in that OAuthSampleTouch application.
- (void)signInToGoogle
{
[self signOut];
NSString *keychainAppServiceName = nil;
if ([self shouldSaveInKeychain])
{
keychainAppServiceName = kAppServiceName;
}
// For GData applications, the scope is available as
// NSString *scope = [[service class] authorizationScope];
NSString *scope = @"http://www.google.com/m8/feeds/";
// ### Important ###
// GDataOAuthViewControllerTouch is not designed to be reused. Make a new
// one each time you are going to show it.
// Display the autentication view.
GDataOAuthViewControllerTouch *viewController = [[[GDataOAuthViewControllerTouch alloc]
initWithScope:scope
language:nil
appServiceName:keychainAppServiceName
delegate:self
finishedSelector:@selector(viewController:finishedWithAuth:error:)] autorelease];
// You can set the title of the navigationItem of the controller here, if you want.
// Optional: display some html briefly before the sign-in page loads
NSString *html = @"<html><body bgcolor=silver><div align=center>Loading sign-in page...</div></body></html>";
[viewController setInitialHTMLString:html];
[[self navigationController] pushViewController:viewController animated:YES];
}
This is code from OAuthSampleTouch example in the class "OAuthSampleRootViewControllerTouch.m" Please check it. What is the scope and from where I need to pass credentials. If I run this I am getting the log as Authentication error:
Please help me, I am trying it from three days.
Any help is much appreciated.
Thank you,
Madan Mohan.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
搜索此方法
在这里您将提供谷歌帐户的用户名和密码。
Search for this method
Here you will be giving username and password for google account..