listenForConsentChanges function should return EmitterSubscription object, but it doesn't do that.
/**
* Listen for consent changes to a particular category
* @param {string} category String of the category ID to listen for
* @callback
* @param {string} category Category that was changed. Matches the category in listener registration
* @param {number} consent Consent value (1 = consent given, 0 = consent not given)
* @returns {object} Returns an event emitter that can be unsubscribed from when your component dismounts
*/
static listenForConsentChanges(category:string, callback = function (category:string,consent:number) {}) {
if (Platform.OS === 'android') {
OneTrust.listenForConsentChanges(category);
DeviceEventEmitter.addListener(category, (consent:number) =>
callback(category, consent),
);
} else {
iOSBroadcast.listenForConsentChanges(category);
const consentListener = new NativeEventEmitter(iOSBroadcast);
consentListener.addListener(category, (consent:number) =>
callback(category, consent),
);
}
}
listenForConsentChanges
function should returnEmitterSubscription
object, but it doesn't do that.It should look like this:
Could you fix this ASAP, please?