简体   繁体   中英

Blackberry Facebook sdk prob for OS 7.0

I am using Blackberry Facebook SDK (FacebookBlackBerrySDK-v0.8.25.jar) for facebook integration for my app. I am using the following code.

ApplicationSettings as = new ApplicationSettings(NEXT_URL, APPLICATION_ID, APPLICATION_SECRET, PERMISSIONS);
Facebook fb = Facebook.getInstance(as);
User user = fb.getCurrentUser();

It is working fine with OS 5.0 and OS 6.0, but it is not working for OS 7.0. For it, it is giving the "Connecting to Facebook" screen, not proceeding further. In the debug screen, we are getting below:

2012-03-12 07:24:29 [INFO] BF-Navigate: https://www.facebook.com/dialog/oauth?scope=user_about_me,user_activities,user_birthday,user_education_history,user_events,user_groups,user_hometown,user_interests,user_likes,user_location,user_notes,user_online_presence,user_photo_video_tags,user_photos,user_relationships,user_relationship_details,user_religion_politics,user_status,user_videos,user_website,user_work_history,email,read_friendlists,read_insights,read_mailbox,read_requests,read_stream,xmpp_login,ads_management,user_checkins,friends_about_me,friends_activities,friends_birthday,friends_education_history,friends_events,friends_groups,friends_hometown,friends_interests,friends_likes,friends_location,friends_notes,friends_online_presence,friends_photo_video_tags,friends_photos,friends_relationships,friends_relationship_details,friends_religion_politics,friends_status,friends_videos,friends_website,friends_work_history,manage_friendlists,friends_checkins,publish_stream,create_event,rsvp_event,offline_access,publish_checkins,manage_pages&redirect_uri=http://www.facebook.com/connect/login_success.html&display=wap&client_id=XXXXXXXXXX&response_type=token   
2012-03-12 07:24:29 [INFO] Access Token not found.

What may be the problem?

This should fix your problem:

  1. Remove display=wap from the request URL (Facebook.java)

  2. Add this line bfc.setProperty(BrowserFieldConfig.USER_AGENT, "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.46 Safari/536.5"); (BrowserScreen.java)

  3. set http://www.facebook.com/connect/login_success.html as REDIRECT_URL (yourApp.java)

  4. go in developer.facebook.com and set your app (sorry I can't share a screenshot):

ADVANCED SETTINGS:

Stream post URL security:Disabled

Remove offline_access permission:Enabled

Timezone-less events:Enabled

Forces use of login secret for auth.login:Disabled

Enhanced Auth Dialog:Enabled

Page Hours Format:Enabled

Batch API Exceptions Format:Enabled

July 2012 Breaking Changes:Enabled

Include Checkins with Statuses:Enabled

August 2012 Breaking Changes:Enabled

  1. load into a real device (doesn't work on OS7 simulators but it works on the OS6 ones)

That's it!

Add this line bfc.setProperty(BrowserFieldConfig.USER_AGENT, "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.46 Safari/536.5"); (BrowserScreen.java)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM