use of com.facebook.share.model.ShareLinkContent in project facebook-android-sdk by facebook.
the class ShareContentValidationTest method testItValidatesNoHttpForShareLinkContentMessage.
// -LinkContent
@Test(expected = FacebookException.class)
public void testItValidatesNoHttpForShareLinkContentMessage() {
Uri imageUri = Uri.parse("ftp://facebook.com/awesome-content.gif");
ShareLinkContent linkContent = buildShareLinkContent(imageUri);
ShareContentValidation.validateForMessage(linkContent);
}
use of com.facebook.share.model.ShareLinkContent in project facebook-android-sdk by facebook.
the class DeviceShareDialog method showImpl.
@Override
protected void showImpl(final ShareContent content, final Object mode) {
if (content == null) {
throw new FacebookException("Must provide non-null content to share");
}
if (!(content instanceof ShareLinkContent) && !(content instanceof ShareOpenGraphContent)) {
throw new FacebookException(this.getClass().getSimpleName() + " only supports ShareLinkContent or ShareOpenGraphContent");
}
Intent intent = new Intent();
intent.setClass(FacebookSdk.getApplicationContext(), FacebookActivity.class);
intent.setAction(DeviceShareDialogFragment.TAG);
intent.putExtra("content", content);
startActivityForResult(intent, getRequestCode());
}
use of com.facebook.share.model.ShareLinkContent in project facebook-android-sdk by facebook.
the class ShareContentValidationTest method testItAcceptsHttpsForShareLinkContent.
@Test
public void testItAcceptsHttpsForShareLinkContent() {
Uri imageUri = Uri.parse("https://facebook.com/awesome-content.gif");
ShareLinkContent linkContent = buildShareLinkContent(imageUri);
ShareContentValidation.validateForApiShare(linkContent);
ShareContentValidation.validateForMessage(linkContent);
ShareContentValidation.validateForNativeShare(linkContent);
ShareContentValidation.validateForWebShare(linkContent);
}
use of com.facebook.share.model.ShareLinkContent in project facebook-android-sdk by facebook.
the class ShareContentValidationTest method testItAcceptNullImageForShareLinkContent.
// Valid Share Contents
@Test
public void testItAcceptNullImageForShareLinkContent() {
ShareLinkContent nullImageContent = buildShareLinkContent(null);
ShareContentValidation.validateForApiShare(nullImageContent);
ShareContentValidation.validateForMessage(nullImageContent);
ShareContentValidation.validateForNativeShare(nullImageContent);
ShareContentValidation.validateForWebShare(nullImageContent);
}
Aggregations