Working with Announcements
Post Announcement¶
Announcement is a special type of posts in Activity Feed that can be posted only from the dashboard by a developer. Announcements are shown only during the period they are posted for.
To post an announcement:
-
Login to GetSocial Dashboard.
-
Go to “Activity Feeds” section.
-
Switch to “Announcements” tab.
-
Press “New announcement” button.
-
Fullfill you announcement content, set an time interval when it should be available on SDK and press “Post”.
You can also change a feed or post an announcement to all existing feeds.
Note
It is possible to post announcements only from the GetSocial Dashboard.
List Announcements¶
If you want to get a list of announcements that are active now, do next:
1 2 3 4 5 6 7 8 9 10 11 | GetSocial.getGlobalFeedAnnouncements(new Callback<List<ActivityPost>>() { @Override public void onSuccess(List<ActivityPost> activityPosts) { Log.i("GetSocial", "Successfully retrieved announcements list"); } @Override public void onFailure(GetSocialException e) { Log.e("GetSocial", "Retrieving failed: " + e.getMessage()); } }); |
Custom Feed Announcements¶
To get a list of announcements for custom feed, simply pass a feed name to getAnnouncements
method:
1 2 3 4 5 6 7 8 9 10 11 12 | String feedName = "level-42"; GetSocial.getAnnouncements(feedName, new Callback<List<ActivityPost>>() { @Override public void onSuccess(List<ActivityPost> activityPosts) { Log.i("GetSocial", "Successfully retrieved announcements list"); } @Override public void onFailure(GetSocialException e) { Log.e("GetSocial", "Retrieving failed: " + e.getMessage()); } }); |
GetSocial UI¶
In the GetSocial Activity Feed UI announcements are shown in the list with simple activities but are placed on the top of the feed before other posts, so users see them first.