iOS“喜欢" facebook应用程序页面,该怎么做? [英] iOS 'like' facebook application page, how to do it?

查看:76
本文介绍了iOS“喜欢" facebook应用程序页面,该怎么做?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
类似于iOS应用程序中的按钮

Possible Duplicate:
Like button in iOS application

我正在尝试让我的应用程序用户更轻松地喜欢"我的facebook应用程序.

I'm trying to make it easier for a user of my App to 'Like' my facebook application.

方案是,用户已经登录并授权了我的应用程序,因此我拥有用户的oauth令牌.由于Graph API不允许这样做,因此我尝试了多种其他方式,但都失败了.

The scenario is, the user has already logged in and authorised my application, so I have the user's oauth token. Since the Graph API does not allow this, I've tried multiple other ways, all unsuccessfully.

方法: 1)在UIWebView中导航到Facebook应用程序的Facebook页面 2)让我的应用程序启动Facebook应用程序到我的Facebook应用程序页面.

Methods: 1) Have it navigate to the facebook application's facebook page in a UIWebView 2) Make my App launch the Facebook App unto my facebook application's page.

在方法1中,主要问题是在很多情况下用户将不得不再次登录Webview,因为我还没有找到将令牌传递给Webview会话的方法.例如,在Foursquare api中,您所需要做的就是将令牌作为查询字符串附加到url,( http://foursquare.com/blabla?access_token = 52521 ... .),这在Facebook中不起作用.

In method 1, the main issue is the user will in many cases have to login in the webview again, because I've not found a way to somehow pass the token to the webview session. In the Foursquare api for example, all you need to do is to append the token to the url as a query string, (http://foursquare.com/blabla?access_token=52521....), this doesnt work in facebook.

在方法2中,可以使用此方法完成:

In method 2, which can be accomplished using this method:

NSString * fbAppUrl = [NSString stringWithFormat:@"fb://applications/%@",[App facebookAppId]];
BOOL didOpenOtherApp = [[UIApplication sharedApplication] openURL:[NSURL URLWithString:fbAppUrl]];

NSString *fbAppUrl = [NSString stringWithFormat:@"fb://applications/%@",[App facebookAppId]];
BOOL didOpenOtherApp = [[UIApplication sharedApplication] openURL:[NSURL URLWithString:fbAppUrl]];

无论我尝试什么,例如fb://applications/%@或fb://pages/%@或fb://profile/%@或fb://feed/%@,facebook应用程序都只是打开空白页.

No matter what I try, i.e. fb://applications/%@ or fb://pages/%@ or fb://profile/%@ or fb://feed/%@, the facebook app just opens to a blank page.

任何人的提示或技巧吗?

Any hints or tips from anyone?

如果不安装facebook应用程序,我希望能够使用方法2并退回到方法1,但从本质上讲,方法1会导致转换率非常低,因此希望避免使用它.

I would love to be able to make use of method 2 and fall back to method 1 if the facebook app is not installed, but in essence, method 1 will result in a very low conversion rate, so hoping to avoid it.

推荐答案

Facebook iPhone应用程序当前不支持,图api也不支持. Facebook支持喜欢" URL的唯一方法是来自其iFrame代码.在博客文章,介绍如何进行选项#1的变体,但查看它们是否通过Safari登录到Facebook.不是最佳的用户体验,而是Facebook目前允许的所有体验.

Facebook iPhone app doesn't currently support that, nor does the graph api. The only way supported by Facebook to "like" a url is from their iFrame code. There is a halfway decent blog post on how to do a variation of option #1 but looks to see if they are logged into Facebook via Safari. Not the best user experience, but all that Facebook allows at the moment.

这篇关于iOS“喜欢" facebook应用程序页面,该怎么做?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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