问题描述
我正在尝试将Facebook整合到我的iphone OS 4.0上。当我尝试显示登录对话框时出现问题。对话框加载然后立即崩溃。相同的代码在IOS 3.1中运行良好。请帮忙。
Thanx。
i am trying to integrate Facebook on my iphone OS 4.0. The problem comes when i try to display dialog box for login. the dialog box loads and then crashes immediately.The same code is working great in IOS 3.1. Please help.Thanx.
推荐答案
我的iPhone应用程序遇到了类似的问题。很可能JavaScript正在崩溃您的应用程序。
I had a similar issue with my iPhone app. Most likely JavaScript is crashing your application.
我通过URL直接访问Facebook登录站点解决了这个问题:
I worked around this issue by accessing Facebook login site directly via URL:http://graph.facebook.com/oauth/authorize?client_id=YOUR_APP_ID&redirect_uri=http://YOUR_SITE_URL&scope=publish_stream,offline_access&type=user_agent&display=touch
如果您在iPhone应用程序中打开该链接,如果用户未登录,它将显示登录屏幕,或者请求发布流媒体和离线访问(按照范围内的指示),然后它将返回到带有access_token的YOUR_SITE_URL,稍后您可以通过Graph API与Facebook进行通信。
If you open that link in your iPhone app, it'll display a login screen if user is not logged in, or ask for permission to Publish Stream & Offline Access (as directed in scope) and then it'll come back to YOUR_SITE_URL with access_token, which you can later use to communicate with Facebook via Graph API.
这篇关于Facebook集成在iphone OS 4.0或更高版本中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!