首页 文章

无法使用facebook android API与Facebook分享照片

提问于
浏览
0

我想从我的Android应用程序分享照片到Facebook . 我正在按照以下指南进行操作 .

Getting Started Android SDK

Sharing on Android

以下是我用来分享的代码 .

if (ShareDialog.canShow(SharePhotoContent.class)) {
    SharePhoto photo = new SharePhoto.Builder().setBitmap(bitap).build();
        SharePhotoContent content = new SharePhotoContent.Builder().addPhoto(photo).build();
        shareDialog.show(MyActivity.this, content);
}

我在facebook开发者控制台中创建了一个facebook应用程序,将我的调试和释放键哈希添加到Facebook应用程序中,将Facebook应用程序ID添加到指南中指定的android应用程序清单中,并完成了指南中指定的所有操作 .

但是,当我分享照片时,Facebook分享对话框会出现几秒钟而消失 . 以下内容记录在Logcat中 .

04-11 12:51:42.692     443-9537/system_process W/ActivityManager﹕ Scheduling restart of crashed service com.facebook.orca/com.facebook.push.mqtt.service.MqttPushService in 1000ms
04-11 12:51:42.895  22617-22824/com.facebook.katana W/fb4a(:<default>):BlueServiceQueue﹕ Exception during service
    com.facebook.http.protocol.ApiException: [code] 100 [message]: Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api [extra]:
            at com.facebook.http.protocol.ApiResponseChecker.b(ApiResponseChecker.java:104)
            at com.facebook.http.protocol.ApiResponseChecker.a(ApiResponseChecker.java:137)
            at com.facebook.http.protocol.ApiResponseChecker.a(ApiResponseChecker.java:234)
            at com.facebook.http.protocol.ApiResponseChecker.a(ApiResponseChecker.java:185)
            at com.facebook.http.protocol.JsonResponseHandler.a(JsonResponseHandler.java:34)
            at com.facebook.http.protocol.ApiResponseHandler.b(ApiResponseHandler.java:91)
            at com.facebook.http.protocol.ApiResponseHandler.a(ApiResponseHandler.java:54)
            at com.facebook.http.protocol.ApiResponseHandler.handleResponse(ApiResponseHandler.java:29)
            at com.facebook.http.common.FbHttpRequestProcessor.a(FbHttpRequestProcessor.java:768)
            at com.facebook.http.common.FbHttpRequestProcessor.a(FbHttpRequestProcessor.java:245)
            at com.facebook.http.common.FbHttpRequestProcessor.a(FbHttpRequestProcessor.java:177)
            at com.facebook.http.common.FbHttpRequestProcessor.a(FbHttpRequestProcessor.java:73)
            at com.facebook.http.common.FbHttpRequestProcessor$Dispatcher.run(FbHttpRequestProcessor.java:956)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            at com.facebook.common.executors.ConstrainedListeningExecutorService$Worker.run(ConstrainedListeningExecutorService.java:288)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at com.facebook.common.executors.NamedThreadFactory$1.run(NamedThreadFactory.java:38)
            at java.lang.Thread.run(Thread.java:841)

我怎样才能找到发生这种情况的原因?有没有办法获得有关为什么不支持get请求的更多信息?

1 回答

  • 0

    从日志错误中,我猜这个权限有问题 . 你能确保正确使用登录过程吗?或者您可以粘贴完整的代码 .

相关问题