private void addCommonParameters(final Bundle bundle, ShareContent shareContent) { final List<String> peopleIds = shareContent.getPeopleIds(); if (!Utility.isNullOrEmpty(peopleIds)) { bundle.putString("tags", TextUtils.join(", ", peopleIds)); } if (!Utility.isNullOrEmpty(shareContent.getPlaceId())) { bundle.putString("place", shareContent.getPlaceId()); } if (!Utility.isNullOrEmpty(shareContent.getPageId())) { bundle.putString("page", shareContent.getPageId()); } if (!Utility.isNullOrEmpty(shareContent.getRef())) { bundle.putString("ref", shareContent.getRef()); } }
public void writeToParcel(final Parcel out, final int flags) { super.writeToParcel(out, flags); out.writeParcelable(this.action, 0); out.writeString(this.previewPropertyName); }
private static void logDialogShare(Context context, ShareContent content, AppCall appCall) { String contentType; DialogFeature dialogFeature = getFeature(content.getClass()); if (dialogFeature == MessageDialogFeature.MESSAGE_DIALOG) { contentType = AnalyticsEvents.PARAMETER_SHARE_DIALOG_CONTENT_STATUS; } else if (dialogFeature == MessageDialogFeature.MESSENGER_GENERIC_TEMPLATE) { contentType = AnalyticsEvents.PARAMETER_SHARE_MESSENGER_GENERIC_TEMPLATE; } else if (dialogFeature == MessageDialogFeature.MESSENGER_MEDIA_TEMPLATE) { contentType = AnalyticsEvents.PARAMETER_SHARE_MESSENGER_MEDIA_TEMPLATE; } else if (dialogFeature == MessageDialogFeature.MESSENGER_OPEN_GRAPH_MUSIC_TEMPLATE) { contentType = AnalyticsEvents.PARAMETER_SHARE_MESSENGER_OPEN_GRAPH_MUSIC_TEMPLATE; } else { contentType = AnalyticsEvents.PARAMETER_SHARE_DIALOG_CONTENT_UNKNOWN; } AppEventsLogger logger = AppEventsLogger.newLogger(context); Bundle parameters = new Bundle(); parameters.putString( AnalyticsEvents.PARAMETER_SHARE_DIALOG_CONTENT_TYPE, contentType); parameters.putString( AnalyticsEvents.PARAMETER_SHARE_DIALOG_CONTENT_UUID, appCall.getCallId().toString()); parameters.putString( AnalyticsEvents.PARAMETER_SHARE_DIALOG_CONTENT_PAGE_ID, content.getPageId()); logger.logSdkEvent(AnalyticsEvents.EVENT_SHARE_MESSENGER_DIALOG_SHOW, null, parameters); } }
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; }
protected ShareContent(final Parcel in) { this.contentUrl = in.readParcelable(Uri.class.getClassLoader()); this.peopleIds = readUnmodifiableStringList(in); this.placeId = in.readString(); this.pageId = in.readString(); this.ref = in.readString(); this.hashtag = new ShareHashtag.Builder().readFrom(in).build(); }
@Override public boolean canShow(final ShareContent content, boolean isBestEffort) { if (content == null || (content instanceof ShareCameraEffectContent) || (content instanceof ShareStoryContent)) { return false; } boolean canShowResult = true; if (!isBestEffort) { // The following features are considered best-effort and will not prevent the // native share dialog from being presented, even if the installed version does // not support the feature. // However, to let apps pivot to a different approach or dialog (for example, Web), // we need to be able to signal back when native support is lacking. if (content.getShareHashtag() != null) { canShowResult = DialogPresenter.canPresentNativeDialogWithFeature( ShareDialogFeature.HASHTAG); } if ((content instanceof ShareLinkContent) && (!Utility.isNullOrEmpty(((ShareLinkContent)content).getQuote()))) { canShowResult &= DialogPresenter.canPresentNativeDialogWithFeature( ShareDialogFeature.LINK_SHARE_QUOTES); } } return canShowResult && ShareDialog.canShowNative(content.getClass()); }
@Override public E readFrom(final P content) { if (content == null) { return (E) this; } return (E) this .setContentUrl(content.getContentUrl()) .setPeopleIds(content.getPeopleIds()) .setPlaceId(content.getPlaceId()) .setPageId(content.getPageId()) .setRef(content.getRef()); } }
@Override public void writeToParcel(final Parcel out, final int flags) { super.writeToParcel(out, flags); out.writeString(effectId); out.writeParcelable(arguments, 0); out.writeParcelable(textures, 0); }
private static void assertContentEquals(final ShareContent a, final ShareContent b) { Assert.assertEquals(a.getContentUrl(), b.getContentUrl()); Assert.assertEquals(a.getPeopleIds(), b.getPeopleIds()); Assert.assertEquals(a.getPlaceId(), b.getPlaceId()); Assert.assertEquals(a.getRef(), b.getRef()); }
public void writeToParcel(final Parcel out, final int flags) { super.writeToParcel(out, flags); out.writeString(this.contentDescription); out.writeString(this.contentTitle); out.writeParcelable(this.imageUrl, 0); out.writeString(this.quote); }
private static Bundle createBaseParameters(ShareContent content, boolean dataErrorsFatal) { Bundle params = new Bundle(); Utility.putUri(params, ShareConstants.LEGACY_LINK, content.getContentUrl()); Utility.putNonEmptyString(params, ShareConstants.LEGACY_PLACE_TAG, content.getPlaceId()); Utility.putNonEmptyString(params, ShareConstants.LEGACY_REF, content.getRef()); params.putBoolean(ShareConstants.LEGACY_DATA_FAILURES_FATAL, dataErrorsFatal); List<String> peopleIds = content.getPeopleIds(); if (!Utility.isNullOrEmpty(peopleIds)) { params.putStringArrayList( ShareConstants.LEGACY_FRIEND_TAGS, new ArrayList<>(peopleIds)); } return params; } }
public void writeToParcel(final Parcel out, final int flags) { super.writeToParcel(out, flags); out.writeString(this.contentDescription); out.writeString(this.contentTitle); out.writeParcelable(this.previewPhoto, 0); out.writeParcelable(this.video, 0); }
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; } }
public void writeToParcel(final Parcel out, final int flags) { super.writeToParcel(out, flags); out.writeString(this.toId); out.writeString(this.link); out.writeString(this.linkName); out.writeString(this.linkCaption); out.writeString(this.linkDescription); out.writeString(this.picture); out.writeString(this.mediaSource); }
@Override public void writeToParcel(final Parcel out, final int flags) { super.writeToParcel(out, flags); out.writeByte((byte)(this.isSharable ? 1 : 0)); out.writeSerializable(this.imageAspectRatio); out.writeParcelable(this.genericTemplateElement, flags); }
@Override public void writeToParcel(final Parcel out, final int flags) { super.writeToParcel(out, flags); out.writeParcelable(this.mBackgroundAsset, 0); out.writeParcelable(this.mStickerAsset, 0); out.writeStringList(this.mBackgroundColorList); out.writeString(this.mAttributionLink); }
public void writeToParcel(final Parcel out, final int flags) { super.writeToParcel(out, flags); SharePhoto.Builder.writePhotoListTo(out, flags, this.photos); }
public void writeToParcel(final Parcel out, final int flags) { super.writeToParcel(out, flags); out.writeParcelableArray((ShareMedia[])this.media.toArray(), flags); }