2017-08-16 100 views
1

使用Facebook的SDK面对的问题,我想分享使用Facebook SDK在Android应用图像 - 作品般的魅力,但是当我试图分享视频没有任何反应。同时共享视频在Android的

下面是我使用的共享视频内容的代码:

@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分享按钮帐户。请在https://developers.facebook.com/docs/sharing/android

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

底部看到您无法使用标准的Android按键