Invites

@objcMembers
@objc(GetSocialInvites)
public class Invites : NSObject

Interface for Invites.

  • Return a list of available channels.

    Declaration

    Swift

    @objc(availableChannelsWithSuccess:failure:)
    public static func availableChannels(success: ResultCallback<[InviteChannel]>, failure: FailureCallback)

    Parameters

    success

    Called with list of available channels.

    failure

    Called if operation failed.

  • Send an invitation with content on the specified channel.

    Declaration

    Swift

    @objc(sendInviteContent:onChannel:success:cancel:failure:)
    public static func send(_ content: InviteContent?,
                            onChannel: String,
                            success: @escaping SuccessCallback,
                            cancel: @escaping CancelCallback,
                            failure: @escaping FailureCallback)

    Parameters

    content

    Content to send.

    onChannel

    Channel to use. Check InviteChannelIds for possible values.

    success

    Called if invitation was sent.

    cancel

    Called if invitation sending was canceled.

    failure

    Called if operation failed.

  • Create an invite with invite url to be shared any custom way.

    Declaration

    Swift

    @objc(createInviteWithContent:success:failure:)
    public static func create(_ content: InviteContent?, success: @escaping ResultCallback<Invite>, failure: @escaping FailureCallback)

    Parameters

    content

    Content to use.

    success

    Called with created invite.

    failure

    Called if operation failed.

  • Create an invite url to be shared any custom way.

    Declaration

    Swift

    @objc(createInviteURLWithContent:success:failure:)
    public static func createURL(_ content: InviteContent?, success: @escaping ResultCallback<String>, failure: @escaping FailureCallback)

    Parameters

    content

    Content to use.

    success

    Called with created invite.

    failure

    Called if operation failed.

  • Register an invite channel plugin for the specified channel id.

    Declaration

    Swift

    @discardableResult
    @objc(registerPlugin:forChannel:)
    public static func register(_ plugin: InviteChannelPlugin, forChannel: String) -> Bool

    Parameters

    plugin

    Plugin to register.

    forChannel

    Channel id. Check InviteChannelIds for possible values. @result YES if the operation was successful, otherwise NO.

  • Set listener to be invoked when referral data is received.

    Declaration

    Swift

    @objc(setOnReferralDataReceivedListener:)
    public static func setOnReferralDataReceivedListener(_ listener: @escaping OnReferralDataReceivedListener)

    Parameters

    listener

    Listener to be invoked.

  • Get list of users who are referred by current user, filtered by the query parameter.

    Declaration

    Swift

    @objc(referredUsersWithQuery:success:failure:)
    public static func referredUsers(_ query: ReferralUsersPagingQuery, success: @escaping ResultCallback<ReferralUsersPagingResult>, failure: @escaping FailureCallback)

    Parameters

    query

    Query to filter referred users.

    success

    Called with list of referred users.

    failure

    Called if operation failed.

  • Get list of users who are referrers of current user, filtered by the query parameter.

    Declaration

    Swift

    @objc(referrerUsersWithQuery:success:failure:)
    public static func referrerUsers(_ query: ReferralUsersPagingQuery, success: @escaping ResultCallback<ReferralUsersPagingResult>, failure: @escaping FailureCallback)

    Parameters

    query

    Query to filter referred users.

    success

    Called with list of referrer users.

    failure

    Called if operation failed.

  • Set referrer details of current user.

    Declaration

    Swift

    @objc(setReferrerWithId:event:customData:success:failure:)
    public static func setReferrer(_ id: UserId, event: String, customData: [String : String]?, success: @escaping SuccessCallback, failure: @escaping FailureCallback)

    Parameters

    id

    Id of referrer user.

    event

    Referrer event.

    customData

    Custom key-value pairs.

    success

    Called if referrer was set.

    failure

    Called if operation failed.