ARTRealtimeAnnotationsProtocol
Objective-C
@protocol ARTRealtimeAnnotationsProtocol
Swift
protocol ARTRealtimeAnnotationsProtocol
The protocol upon which the ARTRealtimeAnnotations is implemented.
-
Publish a new annotation for a message.
Declaration
Objective-C
- (void)publishForMessage:(nonnull ARTMessage *)message annotation:(nonnull ARTOutboundAnnotation *)annotation callback:(nullable ARTCallback)callback;Swift
func publish(for message: ARTMessage, annotation: ARTOutboundAnnotation, callback: ARTCallback? = nil)Parameters
messageThe message to annotate.
annotationThe annotation to publish. (Must include at least the
type. Assumed to be an annotation.create if no action is specified)callbackA success or failure callback function.
-
Publish a new annotation for a message using its serial.
Declaration
Objective-C
- (void)publishForMessageSerial:(nonnull NSString *)messageSerial annotation:(nonnull ARTOutboundAnnotation *)annotation callback:(nullable ARTCallback)callback;Swift
func publish(forMessageSerial messageSerial: String, annotation: ARTOutboundAnnotation, callback: ARTCallback? = nil)Parameters
messageSerialThe serial field of the message to annotate.
annotationThe annotation to publish. (Must include at least the
type. Assumed to be an annotation.create if no action is specified)callbackA success or failure callback function.
-
Delete an annotation for a message.
Declaration
Objective-C
- (void)deleteForMessage:(nonnull ARTMessage *)message annotation:(nonnull ARTOutboundAnnotation *)annotation callback:(nullable ARTCallback)callback;Swift
func delete(for message: ARTMessage, annotation: ARTOutboundAnnotation, callback: ARTCallback? = nil)Parameters
messageThe message to remove the annotation from.
annotationThe annotation to delete. (Must include at least the
type.)callbackA success or failure callback function.
-
Delete an annotation for a message using its serial.
Declaration
Objective-C
- (void)deleteForMessageSerial:(nonnull NSString *)messageSerial annotation:(nonnull ARTOutboundAnnotation *)annotation callback:(nullable ARTCallback)callback;Swift
func delete(forMessageSerial messageSerial: String, annotation: ARTOutboundAnnotation, callback: ARTCallback? = nil)Parameters
messageSerialThe serial field of the message to remove the annotation from.
annotationThe annotation to delete. (Must include at least the
type.)callbackA success or failure callback function.
-
Get all annotations for a given message (as a paginated result).
Declaration
Objective-C
- (void)getForMessage:(nonnull ARTMessage *)message query:(nonnull ARTAnnotationsQuery *)query callback:(nonnull ARTPaginatedAnnotationsCallback)callback;Swift
func getFor(_ message: ARTMessage, query: ARTAnnotationsQuery, callback: @escaping ARTPaginatedAnnotationsCallback)Parameters
messageThe message to get annotations for.
queryRestrictions on which annotations to get (such as a
limiton the size of the result page).callbackA callback for retriving an
ARTPaginatedResultcontaining annotations. -
Get all annotations for a given message (as a paginated result) (alternative form where you only have the serial of the message, not a complete Message object).
Declaration
Objective-C
- (void)getForMessageSerial:(nonnull NSString *)messageSerial query:(nonnull ARTAnnotationsQuery *)query callback:(nonnull ARTPaginatedAnnotationsCallback)callback;Swift
func getForMessageSerial(_ messageSerial: String, query: ARTAnnotationsQuery, callback: @escaping ARTPaginatedAnnotationsCallback)Parameters
messageSerialThe
serialof the message to get annotations for.queryRestrictions on which annotations to get (such as a
limiton the size of the result page).callbackA callback for retriving an
ARTPaginatedResultcontaining annotations. -
Registers a listener that is called each time an
ARTAnnotationis received on the channel.Note that if you want to receive individual realtime annotations (instead of just the rolled-up summaries), you will need to request the
ARTChannelModeAnnotationSubscribeinARTChannelOptions, since they are not delivered by default. In general, most clients will not bother with subscribing to individual annotations, and will instead just look at the summary updates.Declaration
Objective-C
- (ARTEventListener *_Nullable)subscribe: (nonnull ARTAnnotationCallback)callback;Swift
func subscribe(_ callback: @escaping ARTAnnotationCallback) -> ARTEventListener?Parameters
callbackA callback containing received annotation.
Return Value
An event listener object.
-
Registers a listener that is called each time an
ARTAnnotationmatching a giventypeis received on the channel.Note that if you want to receive individual realtime annotations (instead of just the rolled-up summaries), you will need to request the
ARTChannelModeAnnotationSubscribeinARTChannelOptions, since they are not delivered by default. In general, most clients will not bother with subscribing to individual annotations, and will instead just look at the summary updates.Declaration
Objective-C
- (ARTEventListener *_Nullable)subscribe:(nonnull NSString *)type callback: (nonnull ARTAnnotationCallback)callback;Swift
func subscribe(_ type: String, callback: @escaping ARTAnnotationCallback) -> ARTEventListener?Parameters
typeA type of the
ARTAnnotationto register the listener for.callbackA callback containing received annotation.
Return Value
An event listener object.
-
Deregisters all listeners currently receiving
ARTAnnotationfor the channel.Declaration
Objective-C
- (void)unsubscribe;Swift
func unsubscribe() -
Deregisters a specific listener that is registered to receive
ARTAnnotationon the channel.Declaration
Objective-C
- (void)unsubscribe:(nonnull ARTEventListener *)listener;Swift
func unsubscribe(_ listener: ARTEventListener)Parameters
listenerAn event listener to unsubscribe.
-
Deregisters a specific listener that is registered to receive
ARTAnnotationon the channel for a given type.Declaration
Objective-C
- (void)unsubscribe:(nonnull NSString *)type listener:(nonnull ARTEventListener *)listener;Swift
func unsubscribe(_ type: String, listener: ARTEventListener)Parameters
typeA specific annotation type to deregister the listeners for.
listenerAn event listener to unsubscribe.