无法喜欢使用Facebook iOS SDK [英] Unable to like using Facebook iOS SDK

查看:143
本文介绍了无法喜欢使用Facebook iOS SDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试像我的Objective C应用程序一样实现。如果我没有登录到Facebook,那么在点击Like按钮后,应用程序将打开登录屏幕。我将登录我的帐户。然后屏幕变成浅灰色与Facebook的灰色标志一段时间(之前有2个短时间显示灰色的Facebook屏幕),然后我被重定向回到我的应用程序。如果我在运行应用程序时登录到Facebook,除了没有显示登录屏幕,一切都是一样的。



所以我的问题是,我没有得到正确的确认对话框在登录FB帐户后出现,我被重定向回我的应用程序。喜欢没有放置。



这个行为可能是什么原因?



我已经放置了所有3个需要的行进入.plist,这是我如何创建像按钮(p_webView是我的子类UIWebView):

  if(p_webView.fbLikeButton == nil){
p_webView.fbLikeButton = [[FBSDKLikeControl alloc] init];
}
p_webView.fbLikeButton.objectID = p_webView.article.url;
[p_webView.fbLikeButton setFrame:CGRectMake(p_webView.fbLikeButton.frame.origin.x,height + 5,p_webView.fbLikeButton.frame.size.width,p_webView.fbLikeButton.frame.size.height)];
[p_webView.fbLikeButton setCenter:CGPointMake(p_webView.frame.size.width / 2,p_webView.fbLikeButton.center.y)];
[p_webView.scrollView addSubview:p_webView.fbLikeButton];

更多信息 - 我在模拟器上尝试过(我没有FB应用程序,所以是仅使用Safari)。登录后,我有错误:


您所请求的页面目前无法显示,可能暂时不可用,您点击的链接可能已损坏或已过期,或者您可能没有权限查看此页面。


可能很难找到解决方案 - 需要在FB应用程序中使用FB应用程序作为管理员,开发人员或测试人员,以便在测试尚未获得Apple批准使用本机的按钮时使用的应用程序。

解决方案

你做的正确。
也许你缺少一些东西:


  1. 你必须创建fb应用程序ID并将其添加到iOS应用程序。所以你可以点击按钮打开fb应用程序(我想你这样做)


  2. 你必须添加你的fb acc(用于登录)你的fb应用程序中的dev / test角色。如果不是,您将被登录到fb(在fb应用程序或safari)后推回到iOS应用程序。我认为你的问题在这里。
    参考: https://developers.facebook.com/docs/apps/test -users


  3. 如果您希望所有人都可以登录,您必须提交您的应用程序进行审核(使用Native Like按钮)。之后,每个人都可以使用Like按钮。


对于fb应用设置,在状态& ;查看选项卡,打开要将此应用程序及其所有现场功能提供给公众吗?



之后,您可以在仪表板标签中,而不是此应用程序是公开的,可供所有用户使用。此应用程序正处于开发模式并且只能由应用管理员,开发人员和测试人员使用


I am trying to implement like in my Objective C application. If I am not logged into Facebook, then after tapping Like button, application opens login screen. I will log into my account. Then screen goes light gray with gray logo of Facebook for a while (with 2 shortly showed grey facebook screens before that) and then I am redirected back into my app. If I am logged into Facebook when running application, everything is the same except not showing login screen.

So my problem is, that I am not getting correct confirmation dialog that should appear after logging into FB account and I am redirected back into my app. Like is not placed.

What can be cause of this behaviour?

I have placed all 3 needed rows into .plist and this is how I am creating like button (p_webView is my subclass of UIWebView):

if (p_webView.fbLikeButton == nil) {
    p_webView.fbLikeButton = [[FBSDKLikeControl alloc] init];
}
p_webView.fbLikeButton.objectID = p_webView.article.url;
[p_webView.fbLikeButton setFrame:CGRectMake(p_webView.fbLikeButton.frame.origin.x, height + 5, p_webView.fbLikeButton.frame.size.width, p_webView.fbLikeButton.frame.size.height)];
[p_webView.fbLikeButton setCenter:CGPointMake(p_webView.frame.size.width / 2, p_webView.fbLikeButton.center.y)];
[p_webView.scrollView addSubview:p_webView.fbLikeButton];

More information - I have tried this on simulator (there I do not have FB app, so it was using Safari only). After loggin in, I have got error:

"The page you requested cannot be displayed at the moment. It may be temporarily unavailable, the link you clicked on may be broken or expired, or you may not have permission to view this page."

As it might be difficult to find solution - one needs to be in FB app as administrator, developer or tester for like button to work when testing app that has not been approved by Apple for using native like button yet.

解决方案

You are doing right. Maybe you are missing something:

  1. You have to create fb app id and add it to iOS app. So you can open fb app when tap on Like button.(I think you did this)

  2. You have to add your fb acc (using to login) to dev/test roles in your fb app. If not you will be pushed back to iOS app after login to fb (in fb app or safari). <--- I think your problem is here. Ref: https://developers.facebook.com/docs/apps/test-users

  3. If you want everyone can login and like, you have to Submit Your App for Review (with Native Like button). After that, everyone can use Like button.

For the fb app setting, in the "Status & Review" tab, turn on "Do you want to make this app and all its live features available to the general public?"

After that you can see this "This app is public and available to all users" in Dashboard tab, instead of "This app is in development mode and can only be used by app admins, developers and testers"

这篇关于无法喜欢使用Facebook iOS SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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