ARTRealtimeAnnotationsProtocol
Objective-C
@protocol ARTRealtimeAnnotationsProtocol
Swift
protocol ARTRealtimeAnnotationsProtocol
The protocol upon which the ARTRealtimeAnnotations
is implemented.
-
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
inARTChannelOptions
, 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 giventype
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
inARTChannelOptions
, 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.