HashTag

One or more HashTags can be put in a message. A HashTag allows the identification of a message or a photo. Finding content by HashTag is possible and very effective.

Example: Here how to post simple text message with a HashTag

String message = "This is a #hashtag message";

FeedPost feedPost = new FeedPost.Builder()
  .setMessage(message)
  .setVisibility(AccessControl.PUBLIC)
  .build();

Feed createdFeed = session.getNewsFeed().blockingCreate(feedPost);
List<HashTag> hashTags = createdFeed.getBodyMessageTagEntities().getHashTags();

for (HashTag hashTag : hashTags) {
  System.out.println(hashTag.getText());
}
let message = "This is a #hashtag message"

let feedPost = try FeedPost.Builder()
  .setMessage(message)
  .setVisibility(.Public)
    .build()

let createdFeed = try session.newsFeed.blockingCreate(feedPost)
let hashTags = createdFeed?.bodyMessageTagEntities?.hashTags

hashTags?.forEach {
    NSLog($0.text!)
}
let post = (new FeedPost())
    .setMessage("This is a #hashtag message")
    .setVisibility(AccessControl.Public);
let feed = await session.newsFeed.create(post);
let post = (new FeedPost())
    .setMessage("This is a #hashtag message")
    .setVisibility(AccessControl.Public);
session.newsFeed.create(post).then((feed) => {

});

hash_tag JSON object looks like this

{
  "id": 2213798990793426400,
  "created_date": "2018-07-30T12:24:29Z",
  "hash_tag_text": "#hashtag",
  "start_index": 10,
  "end_index": 18,
  "access_control": "PUBLIC",
  "text": "#hashtag",
  "entity_type": "HASH_TAG",
  "displayed_name": "#hashtag",
  "id_str": "2213798990793426528",
  "type": "HashTag"
}