Cannot unsubscribe with application client
myke239 opened this issue · 2 comments
I'm having an issue unsubscribing from a previously submitted subscription.
I've configured my app client exactly how it is described in the documentation.
var Client = require('ibmiotf');
var appClient = new Client.IotfApplication(config);
and subscribed to events
appClient.subscribeToDeviceEvents("+",deviceId,"+");
and listen for events
appClient.on("deviceEvent", function (deviceType, deviceId, eventType, format, payload) {
this.payload = payload.toString('utf8');
});
but when I try to unsubscribe to events with any of the following
appClient.unsubscribeToDeviceEvents();
appClient.unsubscribeToDeviceEvents(type, id, evt, format);
appClient.unsubscribe(topic);
appClient.unsubscribe();
I still continue to receive messages from the original subscription.
I'm running node v9.11.1
Is it me or a bug in the BaseClient or ApplicationClient ??
I just tried this combination:
appClient.subscribeToDeviceEvents("+", deviceid, "+");
and then:
appClient.unsubscribeToDeviceEvents("+", deviceid, "+");
and that combination worked.