If you're sharing links, images or video via the Facebook for Android app, you also need to declare the FacebookContentProvider in the manifest.
Append your app id to the end of the authorities value. For example if your Facebook app id is 1234, the declaration looks like:
<provider android:authorities="com.facebook.app.FacebookContentProvider1234"
android:name="com.facebook.FacebookContentProvider"
android:exported="true" />
If your app is public on Facebook developer portal, you should be able to test sharing with any users. In case it isn't yet public then you need to add the users you want to be able to test sharing:
Add your testers
You can share 3 types of content:
- FacebookSharePhotoContent - Photos
- FacebookShareLinkContent - Link
- FacebookShareVideoContent - Video
await CrossFacebookClient.Current.SharePhotoAsync(myPhotoBytes, captionText);
FacebookSharePhoto photo = new FacebookSharePhoto(text, image);
FacebookSharePhoto[] photos = new FacebookSharePhoto[] { photo };
FacebookSharePhotoContent photoContent = new FacebookSharePhotoContent(photos);
await CrossFacebookClient.Current.ShareAsync(photoContent);
FacebookSharePhoto photo = new FacebookSharePhoto(text, imageUrl);
FacebookSharePhoto[] photos = new FacebookSharePhoto[] { photo };
FacebookSharePhotoContent photoContent = new FacebookSharePhotoContent(photos);
await CrossFacebookClient.Current.ShareAsync(photoContent);
FacebookShareLinkContent linkContent = new FacebookShareLinkContent("awesome plugins",new Uri( "http://www.github.com/crossgeeks"));
var ret = await CrossFacebookClient.Current.ShareAsync(linkContent);
FacebookShareVideo video = new FacebookShareVideo(videoPath);
FacebookShareVideoContent videoContent = new FacebookShareVideoContent(video);
await CrossFacebookClient.Current.ShareAsync(videoContent);
<= Back to Table of Contents