ARTRestPresenceProtocol

Objective-C

@protocol ARTRestPresenceProtocol

Swift

protocol ARTRestPresenceProtocol

The protocol upon which the ARTRestPresence is implemented.

  • Retrieves the current members present on the channel and the metadata for each member, such as their ARTPresenceAction and ID. Returns a ARTPaginatedResult object, containing an array of ARTPresenceMessage objects.

    Declaration

    Objective-C

    - (BOOL)get:(nonnull ARTPresenceQuery *)query
        callback:(nonnull ARTPaginatedPresenceCallback)callback
           error:(NSError *_Nullable *_Nullable)errorPtr;

    Swift

    func get(_ query: ARTPresenceQuery, callback: @escaping ARTPaginatedPresenceCallback) throws

    Parameters

    query

    An ARTPresenceQuery object.

    callback

    A callback for retriving an ARTPaginatedResult object with an array of ARTPresenceMessage objects.

    errorPtr

    A reference to the NSError object where an error information will be saved in case of failure.

    Return Value

    In case of failure returns false and the error information can be retrived via the error parameter.

  • Retrieves a ARTPaginatedResult object, containing an array of historical ARTPresenceMessage objects for the channel. If the channel is configured to persist messages, then presence messages can be retrieved from history for up to 72 hours in the past. If not, presence messages can only be retrieved from history for up to two minutes in the past.

    Declaration

    Objective-C

    - (BOOL)history:(nullable ARTDataQuery *)query
           callback:(nonnull ARTPaginatedPresenceCallback)callback
              error:(NSError *_Nullable *_Nullable)errorPtr;

    Swift

    func history(_ query: ARTDataQuery?, callback: @escaping ARTPaginatedPresenceCallback) throws

    Parameters

    query

    An ARTDataQuery object.

    callback

    A callback for retriving an ARTPaginatedResult object with an array of ARTPresenceMessage objects.

    errorPtr

    A reference to the NSError object where an error information will be saved in case of failure.

    Return Value

    In case of failure returns false and the error information can be retrived via the error parameter.