public final class GetSocial
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
GetSocial.Device |
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 |
claimPromoCode(java.lang.String code,
Callback<PromoCode> callback)
Claim promo code.
|
static void |
clearReferralData()
Clears the referral data.
|
static void |
createInviteLink(LinkParams linkParams,
Callback<java.lang.String> callback)
Creates a Smart Link with user referral data attached used for Smart Invites.
|
static void |
createPromoCode(PromoCodeBuilder promoCodeBuilder,
Callback<PromoCode> callback)
Create a promo code.
|
static void |
deleteActivity(java.lang.String activityId,
CompletionCallback callback)
Deprecated.
|
static void |
findTags(TagsQuery tagsQuery,
Callback<java.util.List<java.lang.String>> callback)
Find all possible tags for query.
|
static void |
findUsers(UsersQuery query,
Callback<java.util.List<UserReference>> callback)
Find users matching query.
|
static void |
getActivities(ActivitiesQuery query,
Callback<java.util.List<ActivityPost>> callback)
Retrieve list of activities.
|
static void |
getActivity(java.lang.String activityId,
Callback<ActivityPost> callback)
Retrieve some activity by id.
|
static void |
getActivityLikers(java.lang.String activityId,
int offset,
int limit,
Callback<java.util.List<PublicUser>> callback)
Get a list of users, that liked activity.
|
static void |
getAnnouncements(java.lang.String feed,
Callback<java.util.List<ActivityPost>> callback)
Retrieve list of announcements for feed.
|
static void |
getGlobalFeedAnnouncements(Callback<java.util.List<ActivityPost>> callback)
Retrieve list of announcements for global feed.
|
static java.util.List<InviteChannel> |
getInviteChannels()
Returns all supported
InviteChannel . |
static java.lang.String |
getLanguage() |
static void |
getPromoCode(java.lang.String code,
Callback<PromoCode> callback)
Get the promo code entity by its code.
|
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 void |
getReferredUsers(Callback<java.util.List<ReferredUser>> callback)
Deprecated.
|
static void |
getReferredUsers(ReferralUsersQuery query,
Callback<java.util.List<ReferralUser>> callback)
Returns list of users who were referred by this user for a specific event.
|
static void |
getReferrerUsers(ReferralUsersQuery query,
Callback<java.util.List<ReferralUser>> callback)
Returns list of users who are referrers for this user for a specific event.
|
static java.lang.String |
getSdkVersion()
The version of GetSocial SDK.
|
static void |
getUserByAuthIdentity(java.lang.String providerId,
java.lang.String providerUserId,
Callback<PublicUser> callback)
Fetch a user by auth provider id and user id on this provider.
|
static void |
getUserById(java.lang.String userId,
Callback<PublicUser> callback)
Fetch a user by their GetSocial userId.
|
static void |
getUsersByAuthIdentities(java.lang.String providerId,
java.util.List<java.lang.String> providerUserIds,
Callback<java.util.Map<java.lang.String,PublicUser>> callback)
Fetch a list of users by their auth identities pairs.
|
static void |
init()
Init the SDK.
|
static void |
init(AuthIdentity identity,
CompletionCallback callback)
Init the SDK with provided identity.
|
static void |
init(java.lang.String appId)
Init the SDK.
|
static boolean |
isInitialized()
Provides the status of the GetSocial initialisation.
|
static boolean |
isInviteChannelAvailable(java.lang.String channelId)
Check if invite channel with specified id is available to sent invitations.
|
static void |
likeActivity(java.lang.String activityId,
boolean isLiked,
Callback<ActivityPost> callback)
Like or unlike activity.
|
static void |
postActivityToFeed(java.lang.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(java.lang.String activityId,
ActivityPostContent comment,
Callback<ActivityPost> callback)
Post comment to activity.
|
static void |
processAction(Action action)
Process action with default GetSocial behaviour.
|
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(java.lang.String channelId,
InviteChannelPlugin inviteChannelPlugin)
Register a new instance of a plugin for a specified channel.
|
static void |
removeActivities(java.util.List<java.lang.String> activityIds,
CompletionCallback callback)
Remove your activities.
|
static boolean |
removeGlobalErrorListener()
Remove global error listener.
|
static void |
reportActivity(java.lang.String activityId,
ReportingReason reportingReason,
CompletionCallback callback)
Report activity because of its content.
|
static void |
reset(CompletionCallback callback)
Set GetSocial to uninitialized state.
|
static void |
sendInvite(java.lang.String channelId,
InviteCallback callback)
Invite friends via the specified invite channel.
|
static void |
sendInvite(java.lang.String channelId,
InviteContent customInviteContent,
CustomReferralData customReferralData,
InviteCallback callback)
Deprecated.
|
static void |
sendInvite(java.lang.String channelId,
InviteContent customInviteContent,
InviteCallback callback)
Invite friends via a specified invite channel.
|
static void |
sendInvite(java.lang.String channelId,
InviteContent customInviteContent,
LinkParams linkParams,
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(java.lang.String languageCode)
Set the language of GetSocial SDK.
|
static void |
setNotificationListener(NotificationListener listener)
Set a notification listener, you can handle a click on notification in
NotificationListener.onNotificationReceived(im.getsocial.sdk.pushnotifications.Notification, boolean) method. |
static void |
setPushNotificationTokenListener(PushTokenListener listener)
Set a listener to be called when Push Notifications token obtained by GetSocial.
|
static void |
setReferrer(java.lang.String referrerId,
java.lang.String event,
java.util.Map<java.lang.String,java.lang.String> customData,
CompletionCallback callback)
Sets referrer id for current user.
|
static boolean |
trackCustomEvent(java.lang.String eventName,
java.util.Map<java.lang.String,java.lang.String> eventProperties)
Reports custom event to Dashboard.
|
static boolean |
trackPurchaseEvent(PurchaseData purchaseData)
Reports in-app purchase to Dashboard.
|
static void |
whenInitialized(java.lang.Runnable action)
Set an action, which should be executed after SDK initialized.
|
public static java.lang.String getSdkVersion()
String
value of the SDK version.public static void init()
whenInitialized(Runnable)
to be notified when SDK is initialized.
GetSocial App Id will be taken from AndroidManifest.xml metadata.
Check errors in logs or in GlobalErrorListener
.public static void init(java.lang.String appId)
whenInitialized(Runnable)
to be notified when SDK is initialized.
Check errors in logs or in GlobalErrorListener
.appId
- GetSocial App Id. You can find your App Id on the GetSocial Dashboard.public static void init(AuthIdentity identity, CompletionCallback callback)
identity
- Identity to be logged into.callback
- Callback to be called when init finished or something went wrong.public static void reset(CompletionCallback callback)
callback
- called when suspension is complete.public static void whenInitialized(java.lang.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 java.lang.String getLanguage()
LanguageCodes
, or default language in case of failure.public static boolean setLanguage(java.lang.String languageCode)
languageCode
- Must be one of language codes provided in LanguageCodes
public static boolean isInviteChannelAvailable(java.lang.String channelId)
channelId
- Is one of the constants defined in InviteChannelIds
.public static java.util.List<InviteChannel> getInviteChannels()
InviteChannel
.InviteChannel
s.public static void sendInvite(java.lang.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(java.lang.String channelId, 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(java.lang.String channelId, InviteContent customInviteContent, CustomReferralData customReferralData, InviteCallback callback)
sendInvite(String, InviteContent, LinkParams, InviteCallback)
instead.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 void sendInvite(java.lang.String channelId, InviteContent customInviteContent, LinkParams linkParams, 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.linkParams
- Link customization parameters.callback
- Called when the invite process is complete.public static boolean registerInviteChannelPlugin(java.lang.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 clearReferralData()
@Deprecated public static void getReferredUsers(Callback<java.util.List<ReferredUser>> callback)
getReferredUsers(ReferralUsersQuery, Callback)
callback
- Called with list of referred users. If there is no referred user, the list is empty.public static void getReferredUsers(ReferralUsersQuery query, Callback<java.util.List<ReferralUser>> callback)
query
- Users query.callback
- Called with list of referred users. If there is no referred user, the list is empty.public static void getReferrerUsers(ReferralUsersQuery query, Callback<java.util.List<ReferralUser>> callback)
query
- Users query.callback
- Called with list of referred users. If there is no referred user, the list is empty.public static void createInviteLink(LinkParams linkParams, Callback<java.lang.String> callback)
linkParams
- Link customization parameters. More info @see herecallback
- Called when the url creation is finished.public static void setReferrer(java.lang.String referrerId, java.lang.String event, java.util.Map<java.lang.String,java.lang.String> customData, CompletionCallback callback)
referrerId
- Id of referrer user.event
- Referrer event.customData
- Custom key-value pairs.callback
- Called when the referrer setting is finished.public static void getGlobalFeedAnnouncements(Callback<java.util.List<ActivityPost>> callback)
callback
- Called with resulting list of activities or failurepublic static void getAnnouncements(java.lang.String feed, Callback<java.util.List<ActivityPost>> callback)
feed
- feed namecallback
- called with resulting list of activities or failurepublic static void getActivities(ActivitiesQuery query, Callback<java.util.List<ActivityPost>> callback)
query
- Filtering optionscallback
- Called with resulting list of activities or failurepublic static void getActivity(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.String activityId, int offset, int limit, Callback<java.util.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 reportActivity(java.lang.String activityId, ReportingReason reportingReason, CompletionCallback callback)
activityId
- Id of activity to report.reportingReason
- Reason of reporting.callback
- Completion callback.@Deprecated public static void deleteActivity(java.lang.String activityId, CompletionCallback callback)
removeActivities(java.util.List<java.lang.String>, im.getsocial.sdk.CompletionCallback)
instead.activityId
- Id of your activity you want to delete.callback
- Completion callback.public static void removeActivities(java.util.List<java.lang.String> activityIds, CompletionCallback callback)
activityIds
- Ids of your activities you want to remove.callback
- Completion callback.public static void findTags(TagsQuery tagsQuery, Callback<java.util.List<java.lang.String>> callback)
tagsQuery
- query.callback
- callback with list of tags, or failure.public static void registerForPushNotifications()
public static void setNotificationListener(NotificationListener listener)
NotificationListener.onNotificationReceived(im.getsocial.sdk.pushnotifications.Notification, boolean)
method.
Or handle notification while application is in foreground.listener
- An object that will be notified with clicked notification.public static void setPushNotificationTokenListener(PushTokenListener listener)
listener
- An object that will be notified with push token.public static void processAction(Action action)
action
- action to be processed.public static void createPromoCode(PromoCodeBuilder promoCodeBuilder, Callback<PromoCode> callback)
promoCodeBuilder
- promo code data.callback
- called with created promo code or error.public static void getPromoCode(java.lang.String code, Callback<PromoCode> callback)
code
- code.callback
- called with promo code or error.public static void claimPromoCode(java.lang.String code, Callback<PromoCode> callback)
code
- code of promo to be claimed.callback
- called with promocode if operation was successful.public static void getUserById(java.lang.String userId, Callback<PublicUser> callback)
userId
- The GetSocial userId.callback
- A callback returning a PublicUser
or error.public static void getUserByAuthIdentity(java.lang.String providerId, java.lang.String providerUserId, Callback<PublicUser> callback)
providerId
- Auth identity provider id for which user id is provided. Can be "facebook", or any custom value.providerUserId
- User id on the selected identity provider for which PublicUser
will be returned.callback
- Callback returning a PublicUser
s or an error.public static void getUsersByAuthIdentities(java.lang.String providerId, java.util.List<java.lang.String> providerUserIds, Callback<java.util.Map<java.lang.String,PublicUser>> callback)
providerId
- A auth identity provider id for which user ids will be provided. Can be "facebook", or any custom value.providerUserIds
- A list of user ids on the selected identity provider for which PublicUser
s will be returned.callback
- A callback returning a map of provider user id with matching PublicUser
with or error. Please note, that not all requested user may be returned.public static void findUsers(UsersQuery query, Callback<java.util.List<UserReference>> callback)
query
- users query.callback
- callback with list of users.public static boolean trackPurchaseEvent(PurchaseData purchaseData)
purchaseData
- Purchase data.public static boolean trackCustomEvent(java.lang.String eventName, java.util.Map<java.lang.String,java.lang.String> eventProperties)
eventName
- Name of custom event.eventProperties
- Properties of custom event.(c) Copyright GetSocial BV, 2021. All Rights Reserved.