Skip to content

Unsubscribe Event

The data collector provides API to let cancel the registered event subscription.

Unsubscribe Event

Unsubscribe Method Parameters Details
consumerWithName name: String Set the consumer name as an identifier for DataCollector
forEventTypes types: [TNEventType] Set the list of event types to unsubscribe

This method returns an error (TNDataCollectorResponse) in case of consumer name is empty (.emptyConsumerName), or list of event types is empty (.emptyTypes). It returns .success in case of successful removing of subscriber.

1
2
3
let types = TNEventType.Favorite.values
dataCollectorClient.unsubscribe(consumerWithName: "consumer_1",
                                forEventTypes: types)
1
2
3
NSArray * types = [TNEventType.Favorite values];
[dataCollectorClient unsubscribeWithConsumerWithName:@"consumer_1"
                                       forEventTypes:types];