Search in sources :

Example 1 with ShareHashtag

use of com.facebook.share.model.ShareHashtag in project facebook-android-sdk by facebook.

the class WebDialogParameters method createForFeed.

public static Bundle createForFeed(ShareLinkContent shareLinkContent) {
    Bundle webParams = new Bundle();
    Utility.putNonEmptyString(webParams, ShareConstants.WEB_DIALOG_PARAM_NAME, shareLinkContent.getContentTitle());
    Utility.putNonEmptyString(webParams, ShareConstants.WEB_DIALOG_PARAM_DESCRIPTION, shareLinkContent.getContentDescription());
    Utility.putNonEmptyString(webParams, ShareConstants.WEB_DIALOG_PARAM_LINK, Utility.getUriString(shareLinkContent.getContentUrl()));
    Utility.putNonEmptyString(webParams, ShareConstants.WEB_DIALOG_PARAM_PICTURE, Utility.getUriString(shareLinkContent.getImageUrl()));
    Utility.putNonEmptyString(webParams, ShareConstants.WEB_DIALOG_PARAM_QUOTE, shareLinkContent.getQuote());
    ShareHashtag shareHashtag = shareLinkContent.getShareHashtag();
    if (shareHashtag != null) {
        Utility.putNonEmptyString(webParams, ShareConstants.WEB_DIALOG_PARAM_HASHTAG, shareLinkContent.getShareHashtag().getHashtag());
    }
    return webParams;
}
Also used : Bundle(android.os.Bundle) ShareHashtag(com.facebook.share.model.ShareHashtag)

Example 2 with ShareHashtag

use of com.facebook.share.model.ShareHashtag in project facebook-android-sdk by facebook.

the class WebDialogParameters method createBaseParameters.

public static Bundle createBaseParameters(ShareContent shareContent) {
    Bundle params = new Bundle();
    ShareHashtag shareHashtag = shareContent.getShareHashtag();
    if (shareHashtag != null) {
        Utility.putNonEmptyString(params, ShareConstants.WEB_DIALOG_PARAM_HASHTAG, shareHashtag.getHashtag());
    }
    return params;
}
Also used : Bundle(android.os.Bundle) ShareHashtag(com.facebook.share.model.ShareHashtag)

Example 3 with ShareHashtag

use of com.facebook.share.model.ShareHashtag in project facebook-android-sdk by facebook.

the class NativeDialogParameters method createBaseParameters.

private static Bundle createBaseParameters(ShareContent content, boolean dataErrorsFatal) {
    Bundle params = new Bundle();
    Utility.putUri(params, ShareConstants.CONTENT_URL, content.getContentUrl());
    Utility.putNonEmptyString(params, ShareConstants.PLACE_ID, content.getPlaceId());
    Utility.putNonEmptyString(params, ShareConstants.PAGE_ID, content.getPageId());
    Utility.putNonEmptyString(params, ShareConstants.REF, content.getRef());
    params.putBoolean(ShareConstants.DATA_FAILURES_FATAL, dataErrorsFatal);
    List<String> peopleIds = content.getPeopleIds();
    if (!Utility.isNullOrEmpty(peopleIds)) {
        params.putStringArrayList(ShareConstants.PEOPLE_IDS, new ArrayList<>(peopleIds));
    }
    ShareHashtag shareHashtag = content.getShareHashtag();
    if (shareHashtag != null) {
        Utility.putNonEmptyString(params, ShareConstants.HASHTAG, shareHashtag.getHashtag());
    }
    return params;
}
Also used : Bundle(android.os.Bundle) ShareHashtag(com.facebook.share.model.ShareHashtag)

Example 4 with ShareHashtag

use of com.facebook.share.model.ShareHashtag in project react-native-fbsdk by facebook.

the class Utility method appendGenericContent.

private static void appendGenericContent(ShareContent.Builder contentBuilder, ReadableMap shareContent) {
    if (shareContent.hasKey("commonParameters")) {
        ReadableMap commonParameters = shareContent.getMap("commonParameters");
        contentBuilder.setPeopleIds(commonParameters.hasKey("peopleIds") ? reactArrayToStringList(commonParameters.getArray("peopleIds")) : null);
        contentBuilder.setPlaceId(getValueOrNull(commonParameters, "placeId"));
        contentBuilder.setRef(getValueOrNull(commonParameters, "ref"));
        if (commonParameters.hasKey("hashtag")) {
            ShareHashtag tag = new ShareHashtag.Builder().setHashtag(commonParameters.getString("hashtag")).build();
            contentBuilder.setShareHashtag(tag);
        }
    }
}
Also used : ReadableMap(com.facebook.react.bridge.ReadableMap) ShareHashtag(com.facebook.share.model.ShareHashtag)

Aggregations

ShareHashtag (com.facebook.share.model.ShareHashtag)4 Bundle (android.os.Bundle)3 ReadableMap (com.facebook.react.bridge.ReadableMap)1