2014-12-04 100 views
0

我嘗試下面的代碼分享對話框的Facebook SDK(組圖)不工作

List<File> list = new ArrayList<File>(); 
       list.add(new File(uri.getPath())); 
       boolean canPresentShareDialogWithPhotos = FacebookDialog.canPresentShareDialog(mContext, FacebookDialog.ShareDialogFeature.PHOTOS); 
       Log.d(TAG, "canPresentShareDialogWithPhotos: " + canPresentShareDialogWithPhotos); 

       if (canPresentShareDialogWithPhotos) { 
        // Publish the post using the Photo Share Dialog 
        FacebookDialog shareDialog = new FacebookDialog.PhotoShareDialogBuilder((Activity) mContext) 
          .addPhotoFiles(list) 
          .build(); 
        shareDialog.present(); 
       } else {} 

我得到canPresentShareDialogWithPhotos值true

回答

0

檢查清單

<provider 
     android:name="com.facebook.NativeAppCallContentProvider" 
     android:authorities="com.facebook.app.NativeAppCallContentProvider1576508475912674" 
     android:exported="true" /> 

替換 「1576508475912674」 by your fbID

+0

不適用於共享內容 – 2016-07-29 06:19:06

相關問題