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

    message

    The message to annotate.

    annotation

    The annotation to publish. (Must include at least the type. Assumed to be an annotation.create if no action is specified)

    callback

    A 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

    messageSerial

    The serial field of the message to annotate.

    annotation

    The annotation to publish. (Must include at least the type. Assumed to be an annotation.create if no action is specified)

    callback

    A 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

    message

    The message to remove the annotation from.

    annotation

    The annotation to delete. (Must include at least the type.)

    callback

    A 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

    messageSerial

    The serial field of the message to remove the annotation from.

    annotation

    The annotation to delete. (Must include at least the type.)

    callback

    A 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

    message

    The message to get annotations for.

    query

    Restrictions on which annotations to get (such as a limit on the size of the result page).

    callback

    A callback for retriving an ARTPaginatedResult containing 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

    messageSerial

    The serial of the message to get annotations for.

    query

    Restrictions on which annotations to get (such as a limit on the size of the result page).

    callback

    A callback for retriving an ARTPaginatedResult containing annotations.

  • Registers a listener that is called each time an ARTAnnotation is 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 ARTChannelModeAnnotationSubscribe in ARTChannelOptions, 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

    callback

    A callback containing received annotation.

    Return Value

    An event listener object.

  • Registers a listener that is called each time an ARTAnnotation matching a given type is 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 ARTChannelModeAnnotationSubscribe in ARTChannelOptions, 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

    type

    A type of the ARTAnnotation to register the listener for.

    callback

    A callback containing received annotation.

    Return Value

    An event listener object.

  • Deregisters all listeners currently receiving ARTAnnotation for the channel.

    Declaration

    Objective-C

    - (void)unsubscribe;

    Swift

    func unsubscribe()
  • Deregisters a specific listener that is registered to receive ARTAnnotation on the channel.

    Declaration

    Objective-C

    - (void)unsubscribe:(nonnull ARTEventListener *)listener;

    Swift

    func unsubscribe(_ listener: ARTEventListener)

    Parameters

    listener

    An event listener to unsubscribe.

  • Deregisters a specific listener that is registered to receive ARTAnnotation on 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

    type

    A specific annotation type to deregister the listeners for.

    listener

    An event listener to unsubscribe.