-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VoipPushNotification.addEventListener('notification', () => {}); call twice #108
Comments
The problem could be in your component re-render. Just track if it was re-rendered or it was fired twice. I bet it is re-render ) even without seeing other parts of your app. |
To make sure it wasn't, I removed everything else and left only this code
the problem has not gone away |
Here is my AppDelegate.mm file
Maybe I made a mistake in it |
Can you please add console.log in useEffect just to see how many times you are attaching listeners. Also you can try to set breakpoints in place where this event is firing in xCode |
Is that possible that you receive 2 voip push notifications? You should debug native objective-C with xCode |
no, I checked it first, push is definitely 1 |
this is what the xcode log shows when the push comes
|
So yeah it is coming from native part - |
I recently was doing some get voip code refactor and I think I know what is your problem. It is because you call voip registration twice: from native code and from js. So I suggest to call voip registration only on native side and using delayed events from didLoadWithEvents you can get registration voip token on JS side. |
HI, this library using VOIP call for react native app? |
Yeah, this lib is just to get voip token, that would be used for iOS CallKit. |
I have the following code in app.js
when push comes i get two calls Alert.alert('Call answer');
What could be the problem?
The text was updated successfully, but these errors were encountered: