0

I have a weird problem when uploading a video to facebook...

My code is based on this answer: Is uploading videos from an SD Card to Facebook possible with the Facebook SDK?

It works perfectly with one facebook app, but not with another.

I have 2 facebook apps that I own as an administrator. Both of them are set up with my debug key hash, and both of them have exactly the same settings.

The ONLY thing I change in my code is the app ID (first app or second app).

The behavior for both apps is:

  1. Authorization is successful
  2. The code that uploads video runs successfully, and onComplete() is called after uploading the video.
  3. For the first app (that works), the video appears on my facebook profile. For the second one, it doesn't.

Again, the only change I do is change the app ID in order to test with each of the 2 facebook apps.

Any insights?

UPDATE

Answered my own question below.

Community
  • 1
  • 1
SirKnigget
  • 3,614
  • 2
  • 28
  • 61
  • Are you using the same user to test both cases? If so, did that user granted the same permissions for both the apps (in specific "user_videos")? Also, do you get some kind of error from facebook in the case in which it does not work? – Nitzan Tomer Apr 17 '12 at 10:30
  • 1. Using the same user of course. 2. Both apps have the same permissions. 3. No errors in the process, the onComplete callbacks are always called for both apps. – SirKnigget Apr 17 '12 at 10:32
  • Solved and answered below - apparently the onComplete() callback can also be an error. – SirKnigget Apr 17 '12 at 10:53
  • I think it might be possible because of the facebook sdk is changed. Please see this answr. Might be helpful to you. http://stackoverflow.com/questions/10151708/upload-video-to-facebook-in-android/12470730#12470730 – Shreyash Mahajan Dec 28 '12 at 05:38

1 Answers1

0

Solved.

The facebook app that works was created a few months ago. The facebook app that doesn't work was created yesterday.

Apparently, in that interval facebook added a new kind of permission - "upload_video". Even the app that worked never requested that permission, but it somehow uploaded the video regardless of it - maybe because of facebook's backwards compatibility.

The way I found this is by noticing that even the onComplete callback has a message, and in that message was the error. Very stupid SDK behavior in my opinion - if I had an error, why call onComplete() and not onFacebookError()?

SirKnigget
  • 3,614
  • 2
  • 28
  • 61