Xcode中的Facebook SDK Singleton [英] Facebook SDK Singleton in xcode

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

问题描述

我已经按照Facebook教程的指示在APPDelegate中使用了Facebook SDK,但是我试图采用单例方法.我发现的每个教程似乎都是针对较旧版本的SDK的,但是我成功做到了这一点 http://indiedevstories.com/2011/08/30/a-facebook-reusable-class/

I have had the Facebook SDK working in the APPDelegate as instructed by the Facebook tutorial, however I am trying to put in into a singleton method. Every tutorial i've found seems to be for an older version of the SDK, but I have managed success with this one http://indiedevstories.com/2011/08/30/a-facebook-reusable-class/

我有2个问题.这是第一个问题,(第二个是此处)

I'm having 2 problems. This is the first problem, (the second is here)

从Safari Facebook登录和授权屏幕返回时,我似乎永远无法获得fbdidLogin的调用. (这在使用AppDelegate方法时有效). 如果我设置[self authorizeWithFBAppAuth:NO safariAuth:NO];然后在Facebook.m中它可以在应用程序内进行授权,但是我感到困惑的是,为什么它不能正常工作. 我见过很多其他问题,没有一个给出明确的答案.

I never seem to be able to get fbdidLogin to be called when returning from the Safari Facebook login and authorize screen. (This worked when using the AppDelegate method). If I set [self authorizeWithFBAppAuth:NO safariAuth:NO]; in Facebook.m then it works authorising within the app but i'm puzzled why it won't work as it should. I've seen many questions asked elsewhere, none with a definitive answer.

谢谢

推荐答案

我更新了单例课程,将分数发布到Facebook Wall.查看新版本: http://indiedevstories.com/2012/04/11/facebookscorer-post-highscores-to-users-facebook-wall/

I have updated the singleton class to post scores to Facebook Wall. Check out the new version: http://indiedevstories.com/2012/04/11/facebookscorer-post-highscores-to-users-facebook-wall/

HTH

这篇关于Xcode中的Facebook SDK Singleton的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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