2017-08-16 4 views
1

アンドロイドアプリでfacebook SDKを使用して画像を共有しようとしましたが、チャームのように動作します。アンドロイドのFacebook SDKを使用してビデオを共有する際に直面する問題

次は私がビデオコンテンツを共有するために使用しているコードです:

@Override 
public void onClick(View v) { 
    switch(v.getId()){ 
     case R.id.fb_share_button: 
      ShareVideo shareVideo1= new ShareVideo.Builder() 
        .setLocalUrl(Uri.parse("https://imdstar.com/clubapp/wp-content/uploads/2017/07/Chennaionline-AirtelParallelMusicFestival106-online-video-cutter.com_.mp4")) 
        .build(); 


      ShareVideoContent shareContent = new ShareVideoContent.Builder() 
        .setVideo(shareVideo1) 
        .build(); 
      shareButton.setShareContent(shareContent); 
      shareDialog.show(shareContent, ShareDialog.Mode.AUTOMATIC); 
      break; 

     default: 
      break; 
    } 


} 

方法は、共有ボタンをクリックで呼び出さなっているが、sharing.Pleaseは私にあなたの貴重な提案どこを与えるために何のダイアログボックスが表示されません私は間違いを犯している。

答えて

1

あなたはリンクを共有しようとしていますが、そのコードを使用してあなたのデバイスにあるビデオを共有しています。

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

を見ていると、リンク

ShareLinkContent content = new ShareLinkContent.Builder() 
     .setContentUrl(Uri.parse("https://developers.facebook.com")) 
     .build(); 

を共有するためのコードを使用してみてください、あなたがFacebookで共有ボタンを使用する必要があることを考慮に入れてください。あなたは、標準のAndroidのボタンを使用することはできませんhttps://developers.facebook.com/docs/sharing/android

ShareButton shareButton = (ShareButton)findViewById(R.id.fb_share_button); 
shareButton.setShareContent(content); 

の下部にご覧下さい

関連する問題