public final class GetSocial extends Object
Modifier and Type | Class and Description |
---|---|
static class |
GetSocial.User
Static class that exposes methods to retrieve and modify
the current GetSocial user.
|
Modifier and Type | Method and Description |
---|---|
static void |
getActivities(ActivitiesQuery query,
Callback<List<ActivityPost>> callback)
Retrieve list of activities.
|
static void |
getActivity(String activityId,
Callback<ActivityPost> callback)
Retrieve some activity by id.
|
static void |
getActivityLikers(String activityId,
int offset,
int limit,
Callback<List<PublicUser>> callback)
Get a list of users, that liked activity.
|
static void |
getAnnouncements(String feed,
Callback<List<ActivityPost>> callback)
Retrieve list of announcements for feed.
|
static void |
getGlobalFeedAnnouncements(Callback<List<ActivityPost>> callback)
Retrieve list of announcements for global feed.
|
static List<InviteChannel> |
getInviteChannels()
Returns all supported
InviteChannel . |
static String |
getLanguage() |
static void |
getReferralData(FetchReferralDataCallback callback)
Get the referral data from the deep link that started the application or after the application was installed
from the deep link.
|
static String |
getSdkVersion()
The version of GetSocial SDK.
|
static void |
getUserById(String userId,
Callback<PublicUser> callback)
Fetch a user by their GetSocial userId.
|
static boolean |
isInitialized()
Provides the status of the GetSocial initialisation.
|
static void |
likeActivity(String activityId,
boolean isLiked,
Callback<ActivityPost> callback)
Like or unlike activity.
|
static void |
postActivityToFeed(String feed,
ActivityPostContent activity,
Callback<ActivityPost> callback)
Post activity to Activity Feed with provided name.
|
static void |
postActivityToGlobalFeed(ActivityPostContent activity,
Callback<ActivityPost> callback)
Post activity to global Activity Feed.
|
static void |
postCommentToActivity(String activityId,
ActivityPostContent comment,
Callback<ActivityPost> callback)
Post comment to activity.
|
static void |
registerForPushNotifications()
If im.getsocial.sdk.AutoRegisterForPush meta property is set to false in the AndroidManifest.xml,
call this method to register for push notifications.
|
static boolean |
registerInviteChannelPlugin(String channelId,
InviteChannelPlugin inviteChannelPlugin)
Register a new instance of a plugin for a specified channel.
|
static boolean |
removeGlobalErrorListener()
Remove global error listener.
|
static void |
sendInvite(String channelId,
InviteCallback callback)
Invite friends via the specified invite channel.
|
static void |
sendInvite(String channelId,
InviteContent customInviteContent,
CustomReferralData customReferralData,
InviteCallback callback)
Invite friends via a specified invite channel.
|
static void |
sendInvite(String channelId,
InviteContent customInviteContent,
InviteCallback callback)
Invite friends via a specified invite channel.
|
static boolean |
setGlobalErrorListener(GlobalErrorListener errorListener)
Set the global error listener instance, that will we notified about internal exceptions in the SDK.
|
static boolean |
setLanguage(String languageCode)
Set the language of GetSocial SDK.
|
static void |
setNotificationActionListener(NotificationActionListener listener)
Set a notification action listener, you can handle a click on notification in
NotificationActionListener.onActionReceived(NotificationAction) method. |
static void |
uploadImage(android.graphics.Bitmap image,
Callback<String> callback) |
static void |
whenInitialized(Runnable action)
Set an action, which should be executed after SDK initialized.
|
public static String getSdkVersion()
String
value of the SDK version.public static void whenInitialized(Runnable action)
action
- Action to execute.public static boolean isInitialized()
public static boolean setGlobalErrorListener(GlobalErrorListener errorListener)
errorListener
- instance to be notifiedpublic static boolean removeGlobalErrorListener()
public static String getLanguage()
LanguageCodes
, or default language in case of failure.public static boolean setLanguage(String languageCode)
languageCode
- Must be one of language codes provided in LanguageCodes
public static List<InviteChannel> getInviteChannels()
InviteChannel
.InviteChannel
s.public static void sendInvite(String channelId, InviteCallback callback)
channelId
- The channel through which the invite will be sent, one of the constants defined in InviteChannelIds
.callback
- Called when the invite process is complete.public static void sendInvite(String channelId, @Nullable InviteContent customInviteContent, InviteCallback callback)
channelId
- The channel through which the invite will be sent, one of the constants defined in InviteChannelIds
.customInviteContent
- Custom content to override the default content provided from the Dashboard.callback
- Called when the invite process is complete.public static void sendInvite(String channelId, @Nullable InviteContent customInviteContent, @Nullable CustomReferralData customReferralData, InviteCallback callback)
channelId
- The channel through which the invite will be sent, one of the constants defined in InviteChannelIds
.customInviteContent
- Custom content to override the default content provided from the Dashboard.customReferralData
- Custom data to be associated with this invite.callback
- Called when the invite process is complete.public static boolean registerInviteChannelPlugin(String channelId, InviteChannelPlugin inviteChannelPlugin)
channelId
- Id of the channel for the plugin implementation, one of the constants defined in InviteChannelIds
.inviteChannelPlugin
- An instance of a plugin implementation.public static void getReferralData(FetchReferralDataCallback callback)
callback
- Called with referral data or failure.public static void getGlobalFeedAnnouncements(Callback<List<ActivityPost>> callback)
callback
- Called with resulting list of activities or failurepublic static void getAnnouncements(String feed, Callback<List<ActivityPost>> callback)
feed
- feed namecallback
- called with resulting list of activities or failurepublic static void getActivities(ActivitiesQuery query, Callback<List<ActivityPost>> callback)
query
- Filtering optionscallback
- Called with resulting list of activities or failurepublic static void getActivity(String activityId, Callback<ActivityPost> callback)
activityId
- Identifier of activity.callback
- Called with resulting activity or failurepublic static void postActivityToGlobalFeed(ActivityPostContent activity, Callback<ActivityPost> callback)
activity
- Content of activity, that should be postedcallback
- Called with activity, that was created, or failurepublic static void postActivityToFeed(String feed, ActivityPostContent activity, Callback<ActivityPost> callback)
feed
- Name of the feedactivity
- Content of activity, that should be postedcallback
- Called with activity, that was created, or failurepublic static void postCommentToActivity(String activityId, ActivityPostContent comment, Callback<ActivityPost> callback)
activityId
- Identifier of activity, that we want to commentcomment
- Content of comment, that should be postedcallback
- Called with comment activity, that was created, or failurepublic static void likeActivity(String activityId, boolean isLiked, Callback<ActivityPost> callback)
activityId
- Identifier of activity, that we want to like or unlikeisLiked
- Should activity be liked or notcallback
- Called with comment activity, that was liked, or failurepublic static void getActivityLikers(String activityId, int offset, int limit, Callback<List<PublicUser>> callback)
activityId
- Identifier of activity, that we want to get who liked itoffset
- Offset positionlimit
- Limit of list you want to getcallback
- Called with list of users, who liked activity, or failurepublic static void registerForPushNotifications()
public static void setNotificationActionListener(NotificationActionListener listener)
NotificationActionListener.onActionReceived(NotificationAction)
method.listener
- An object that will be notified with clicked notification.public static void uploadImage(android.graphics.Bitmap image, Callback<String> callback)
public static void getUserById(String userId, Callback<PublicUser> callback)
userId
- The GetSocial userId.callback
- A callback returning a PublicUser or error.(c) Copyright GetSocial BV, 2017. All Rights Reserved.