4

私はFacebookのShareDialogを使用して、自分のアプリ内でFacebookのprintScreen画像を共有しています。facebook share appがインストールされていないときのダイアログ - 奇妙な動作?

Facebookアプリがインストールされているときは正常に動作します。

Facebookアプリがインストールされていないと動作しません。 「読み込み中」の画面が表示され、それが消えて何も起こりません。 共有ダイアログオブジェクトは、FacebookExceptionとコールバックをonErrorを達する:

{FacebookGraphResponseException: (#200) Requires extended permission: publish_actions httpResponseCode: 403, facebookErrorCode: 200, facebookErrorType: OAuthException, message: (#200) Requires extended permission: publish_actions} 

は、だから私は本当に唯一のFacebookアプリのためのFacebookのウェブやないため、「publish_actions」権限が必要なのでしょうか?奇妙な..

Facebook writes: 

https://developers.facebook.com/docs/sharing/android

"If the Facebook app is not installed it will automatically fallback to the web-based dialog" 

"Now the SDK automatically checks for the native Facebook app. If it isn't installed, the SDK switches people to their default browser and opens the Feed Dialog." 

私のコード:Facebookアプリが "publish_actions" なしでインストールされたときにログインfacebook動作しない場合

mShareDialog = new ShareDialog(mActivity); 

    mShareDialog.registerCallback(callbackManager, new FacebookCallback<Sharer.Result>() { 
     @Override 
     public void onSuccess(Sharer.Result result) {} 

     @Override 
     public void onCancel() {} 

     @Override 
     public void onError(FacebookException error) { 
      if (error != null) { 
       showDialog("facebook app isn't installed"); 
      } 
     } 
    }); 

    if (ShareDialog.canShow(ShareLinkContent.class)) { 

     // get a screenshot 
     Bitmap image = getScreenshot(); 

     SharePhoto photo = new SharePhoto.Builder() 
       .setBitmap(image) 
       .setCaption(getResources().getString(R.string.shareBodyText)) 
       .build(); 

     SharePhotoContent content = new SharePhotoContent.Builder() 
       .addPhoto(photo) 
       .build(); 

     mShareDialog.show(content); 
    } 

、なぜそれが動作しませんアプリはインストールされていませんか?

答えて

-1

SharePhotoContentの要件であるため、写真を共有するためにネイティブfaceboookアプリをインストールする必要があります。

Facebook Docsから

写真

人々が共有 ダイアログまたはカスタムインターフェイスでのFacebookにアプリから写真を共有することができます。

  • 写真のサイズは12メガバイト未満でなければなりません
  • 人々は、インストールAndroidアプリのバージョン7.0以上
をネイティブのFacebookが必要
関連する問題