6

I have an app that posts a string to user's wall. The app worked ok in the emulator but I could not make it work in a real device. At first I thought I have a problem with the hash key. But then I tried it on a device that does not have Fb installed on it and it worked. When I installed Fb on the device it did not post and uninstalling it again it works fine. I assume that the Facebook app is blocking my app from using the SDK? The approach I use is more or less following this -> http://blog.doityourselfandroid.com/2011/02/28/30-minute-guide-integrating-facebook-android-application/ but I get the same with other approaches.

I see that there is a problem reading this -> Post to user facebook wall not working when Facebook app is installed on device/emulator but what should I do to solve it? I do not want my users to have to uninstall Fb of course! Has anyone come to the same situation and managed to solve it?

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
george
  • 1,386
  • 5
  • 22
  • 38

3 Answers3

4

Small Changes in the code (facebook package)

Look into authorize function in facebook.java file. try to comment out the singlesignon and use startdialog() only... something like this.. hope it helps.

RajaReddy PolamReddy
  • 22,428
  • 19
  • 115
  • 166
  • Yo mean that this code: // Prefer single sign-on, where available. if (activityCode >= 0) { singleSignOnStarted = startSingleSignOn(activity, mAppId, permissions, activityCode); } // Otherwise fall back to traditional dialog. if (!singleSignOnStarted) { startDialogAuth(activity, permissions); } should be changed to just this -> startDialogAuth(activity, permissions); so that SSO will be disabled? – george Dec 30 '11 at 10:18
  • in the com.facebook.android comment startSingleSignOn() fuction and startDialogAuth(activity, permissions); enable. (don't comment this line. – RajaReddy PolamReddy Dec 30 '11 at 10:40
  • I had some authentication problems, but now it works. Thanks! – george Jan 08 '12 at 15:07
2

I have faced the same problem and I had to disable SSO to enable it to work.

Mohamed_AbdAllah
  • 5,311
  • 3
  • 28
  • 47
0

above answer given by Raja is perfect..

this is what i did and worked perfectly... earlier i found difficult to understand what to do exactly...

so this is what i did... hope this may help others

// Prefer single sign-on, where available.
//      if (activityCode >= 0) {
//          singleSignOnStarted = startSingleSignOn(activity, mAppId,
//                  permissions, activityCode);
//      }
// Otherwise fall back to traditional dialog.
Neha
  • 245
  • 5
  • 17