问题
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.
回答1:
I had a similar issue with my iPhone app. Most likely JavaScript is crashing your application.
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
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.
回答2:
There is a lot of issues related to app crashes, you might want to use the debugger and post the problematic codes for review.
回答3:
Make sure you are running the latest version of the Facebook SDK from Github. And please post the code that is crashing.
来源:https://stackoverflow.com/questions/5209205/facebook-integration-in-iphone-os-4-0-or-later