Facebook for android video upload - works with one app and not with another

烂漫一生 提交于 2019-12-11 17:33:16

问题


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.


回答1:


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()?



来源:https://stackoverflow.com/questions/10189389/facebook-for-android-video-upload-works-with-one-app-and-not-with-another

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!