I’m currently having this error trying to use this package in my react native expo app using a development build both in android and ios ,
package versions :
“expo”: “~48.0.11”,
“react-native”: “0.71.8”,
“react-native-zohosalesiq-mobilisten”: “^6.1.0”,
From my findings, I suspect it could be an issue related to the newer version of the RN > 0.65.0 as mentioned in this issue
opened 06:10PM - 19 Aug 21 UTC
closed 10:26PM - 23 Aug 21 UTC
Bug
🏠 Reanimated 2
<!--
NOTE: please submit only bug reports here, any new questions or feature re… quests should be submitted in Discussions:
https://github.com/software-mansion/react-native-reanimated/discussions
-->
## Description
<!--
Tell us what's happening here.
-->
A lot of libraries, including this one is showing a warning with the message: "new NativeEventEmitter() was called with a non-null argument without the required `addListener/removeListeners` method." Like the image below:

This warning is shown because of the commit [114be1d](https://github.com/facebook/react-native/commit/114be1d2170bae2d29da749c07b45acf931e51e2), which checks if the Native Module has the methods: `addListener` and `removeListeners`. These checks are necessary because of this commit [f5502fb](https://github.com/facebook/react-native/commit/f5502fbda9fe271ff6e1d0da773a3a8ee206a453), which tries to use the Native Module to notify subscriptions on Android. So I think this issue is only related to Android and the 0.65.0 release.
Doing some tests in **_another libraries_** with the old architecture I was able to fix it adding those methods in the Native Module in Java:
```
@ReactMethod
public void addListener(String eventName) {
// Keep: Required for RN built in Event Emitter Calls.
}
@ReactMethod
public void removeListeners(Integer count) {
// Keep: Required for RN built in Event Emitter Calls.
}
```
I don't know if this is the best method to handle this issue, but I think it's don't cause any trouble like was commented in this commit [f5502fb](https://github.com/facebook/react-native/commit/f5502fbda9fe271ff6e1d0da773a3a8ee206a453).
### Expected behavior
Do not show any warning in the console about the NativeEventEmitter.
### Actual behavior & steps to reproduce
Just build react-native 0.65.0 with this library and execute the most basic example in the docs.
## Snack or minimal code example
The first example in the docs: https://docs.swmansion.com/react-native-reanimated/docs/animations
<!--
Please provide a minimal code example that reproduces the issue in [Snack](https://snack.expo.io/) or link to the Github repository.
Here are some tips for providing a minimal example: [https://stackoverflow.com/help/mcve](https://stackoverflow.com/help/mcve).
-->
## Package versions
<!--
Fill in your Reanimated and React Native versions below.
List other libraries if relevant.
-->
- React Native: 0.65.0
- React Native Reanimated: 2.3.0-alpha.2
- NodeJS: 14.17.3
- Xcode:
- Java & Gradle: 11.0.10 / 6.9
## Affected platforms
- [X] Android
- [ ] iOS
- [ ] Web
I would appreciate any help to fix this issue as it is a blocker for me at the moment.
Code example from docs .
import { Platform } from 'react-native';
import { ZohoSalesIQ } from 'react-native-zohosalesiq-mobilisten';
var appKey;
var accessKey;
if (Platform.OS === 'ios') {
appKey = "....";
accessKey = "...";
} else {
appKey = "....";
accessKey = "....";
}
ZohoSalesIQ.initWithCallback(appKey, accessKey, (success: any) => {
if (success) {
ZohoSalesIQ.setLauncherVisibility(true);
// To show the default live chat launcher, you can use the setLauncherVisibility API.
// Alternatively, you may use the 'Avail floating chat button for your app' option under Settings → Brands → Installation → Android/iOS.
} else {
// your code to handle initialization failure
}
});