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 aARTPaginatedResult
object, containing an array ofARTPresenceMessage
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 ofARTPresenceMessage
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 theerror
parameter. -
Retrieves a
ARTPaginatedResult
object, containing an array of historicalARTPresenceMessage
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 ofARTPresenceMessage
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 theerror
parameter.