Class Invites


  • public final class Invites
    extends java.lang.Object
    • Method Detail

      • getAvailableChannels

        public static void getAvailableChannels​(Callback<java.util.List<InviteChannel>> success,
                                                FailureCallback failure)
        Get the list of available invite channels. Contains only channels enabled on the Dashboard and available on the device.
        Parameters:
        success - called with a list of available invite channels.
        failure - called if operation failed.
      • send

        public static void send​(InviteContent customInviteContent,
                                java.lang.String channelId,
                                CompletionCallback success,
                                CompletionCallback cancel,
                                FailureCallback failure)
        Invite friends via a specified invite channel.
        Parameters:
        customInviteContent - Custom content to override the default content provided from the Dashboard.
        channelId - The channel through which the invite will be sent, one of the constants defined in InviteChannelIds.
        success - Called when the invite process is complete.
        cancel - Called if a user canceled an invite.
        failure - Called if operation failed.
      • create

        public static void create​(InviteContent customInviteContent,
                                  Callback<Invite> success,
                                  FailureCallback failure)
        Create invite with localized values and a link.
        Parameters:
        customInviteContent - Custom content to override the default content provided from the Dashboard.
        success - Called with invite content when it is created.
        failure - Called if operation failed.
      • registerPlugin

        public static boolean registerPlugin​(InviteChannelPlugin inviteChannelPlugin,
                                             java.lang.String channelId)
        Register a new instance of a plugin for a specified channel.
        Parameters:
        inviteChannelPlugin - An instance of a plugin implementation.
        channelId - Id of the channel for the plugin implementation, one of the constants defined in InviteChannelIds.
        Returns:
        true if the operation was successful, false otherwise.
      • setReferralDataListener

        public static void setReferralDataListener​(ReferralDataListener listener)
        Set listener to receive referral data if there is any.
        Parameters:
        listener - to be called with a new referral data.
      • getReferredUsers

        public static void getReferredUsers​(PagingQuery<ReferralUsersQuery> query,
                                            Callback<PagingResult<ReferralUser>> callback,
                                            FailureCallback failure)
        Returns list of users who were referred by this user for a specific event.
        Parameters:
        query - Users query.
        callback - Called with list of referred users. If there is no referred user, the list is empty.
        failure - Called if operation failed.
      • getReferrerUsers

        public static void getReferrerUsers​(PagingQuery<ReferralUsersQuery> query,
                                            Callback<PagingResult<ReferralUser>> callback,
                                            FailureCallback failure)
        Returns list of users who are referrers for this user for a specific event.
        Parameters:
        query - Users query.
        callback - Called with list of referred users. If there is no referred user, the list is empty.
        failure - Called if operation failed.
      • createLink

        public static void createLink​(java.util.Map<java.lang.String,​java.lang.Object> linkParams,
                                      Callback<java.lang.String> callback,
                                      FailureCallback failure)
        Creates a Smart Link with user referral data attached used for Smart Invites.
        Parameters:
        linkParams - Link customization parameters. More info @see here
        callback - Called when the url creation is finished.
        failure - Called if operation failed.
      • setReferrer

        public static void setReferrer​(UserId referrerId,
                                       java.lang.String event,
                                       java.util.Map<java.lang.String,​java.lang.String> customData,
                                       CompletionCallback callback,
                                       FailureCallback failure)
        Sets referrer id for current user.
        Parameters:
        referrerId - Id of referrer user.
        event - Referrer event.
        customData - Custom key-value pairs.
        callback - Called when the referrer setting is finished.
        failure - Called if operation failed.