Facebook iOS SDK - 写入状态的奇怪效果 [英] Facebook iOS SDK - Strange Effects in Writing to Status

查看:122
本文介绍了Facebook iOS SDK - 写入状态的奇怪效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在更新我的应用程序以使用xCode 4,iOS5和最新的Facebook SDK。所有的工作都很好。



现在,两个奇怪的事情发生了,尽管查看所有的代码和搜索论坛,我看不出为什么。

请参阅下面的更新



首次登录 / p>

当用户刚刚登录时,如果他们共享状态或取消尝试这样做,脚本将显示如下:

 < script type =text / javascript> window.location.href =fbconnect:\ / \ / success#_ = _; 
< / script>

所有其他功能(e..g,当它不是第一次)似乎工作正常。 / p>

我怀疑这与回拨不起动有关,但是我已经检查了所有的委托设置等。所有的facebook代表方法都在appDelegate中,然后从视图控制器引用。



有其他人有这个问题吗?任何指针都将受到热烈的欢迎。我还没有发布任何代码,因为我不知道哪一点专注,我已经使用了facebook开发者网站的所有标准代码。



许多谢谢,



Chris。



更新



感谢@Kristofer Sommestad和@Senior为他们的帮助。我有一些问题。



不要授权两次



Feed对话请求也请求授权,所以不要同时请求它们。



更新SDK



在发现我的问题后,SDK已更新 - 因此请继续检查。



我没有意识到,所需的代码使用SDK代码已经改变了,具体是调用feed对话框的代码。查看 https://developers.facebook.com/docs/reference/dialogs/feed/



注销方式



注销只需登录您的应用程序中的用户不在Facebook上。

解决方案

我也经历过第一个问题,但是通过确保身份验证没有被触发两次。最初,我做了以下工作:

  [_ facebook authorize:permissions]; 
[_facebook dialog:@feedandParams:params andDelegate:self];

不知道这是你的问题,但是我注意到,这实际上触发了2个身份验证对话框,其中第二个与您输出的Javascript输出结果一致。
由于某种原因,我认为如果授权已经这样做,第二个不会触发对话框。



相反,我确实先确定授权:,但不会触发对话框:andParams:andDelegate 直到使用 -fbDidLogin 完成授权(并保存对话框数据以作为实例变量共享)。



还没有看到任何问题仍然能够发布消息,但也许它与第一个问题有关(?)。



希望这也有助于您。


I'm updating my app to use xCode 4, iOS5 and the latest Facebook SDK. All was working fine before.

Now, two strange things are happening and despite reviewing all the code and searching the forums, I can't see why.

See update below.

Logging in for first time

When the user has just logged in, if they either share the status or cancel the attempt to do so, a script is displayed as follows:

<script type="text/javascript"> window.location.href="fbconnect:\/\/ success#_=_";
</script>

All other functionality (e..g when its not the first time) seems to work fine.

I suspect this is something to do with call backs not firing, but I've double checked all the delegate setting etc. All the facebook delegate methods are in the appDelegate and then referred to from the view controller.

Has anyone else had this issue? Any pointers would be warmly welcomed. I haven't posted any code yet as I'm not sure which bit to focus on and I've used all the standard code from the facebook developer site.

Many thanks,

Chris.

UPDATE

Thanks to @Kristofer Sommestad and @Senior for their help. I had a number of issues.

Don't Authorise Twice

The feed dialog request also requests an authorisation, so don't request them both at the same time.

Updated SDK

The SDK was updated after I found my issues - so keep checking.

What I hadn't realised was that the required code to use the SDK code had changed, specifically the code to call the feed dialog. Check out https://developers.facebook.com/docs/reference/dialogs/feed/.

What Logout Means

Logging out just logs the user out of your App, not out of facebook.

解决方案

I also experienced the first issue, but solved it by making sure authentication wasn't triggered twice. Initially, I had done the following:

[_facebook authorize:permissions];
[_facebook dialog:@"feed" andParams:params andDelegate:self];

Not sure this is your problem, but I noticed that this messed things up as it actually triggered 2 authentication dialogs, where the second one ended up with the Javascript output you're also seeing. For some reason I had figured that the second one wouldn't trigger a dialog if authorize already had done so....

Instead, I made sure to authorize: first, but not trigger the dialog:andParams:andDelegate until the authorization was completed with -fbDidLogin (and saving the dialog data to share as an instance variable).

Haven't seen any issues with still being able to post messages, but maybe it's related to the first issue somehow (?).

Hope this helps you out too.

这篇关于Facebook iOS SDK - 写入状态的奇怪效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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