react-native-callkeep icon indicating copy to clipboard operation
react-native-callkeep copied to clipboard

*didLoadWithEvents* is not working.

Open samad324 opened this issue 5 years ago • 18 comments

Bug report

  • [x] I've checked the example to reproduce the issue.

  • Reproduced on:

  • [ ] Android

  • [x] iOS

Description

Hi there, I'm facing the same issue as described in #107, and try to add didLoadWithEvents event right after RNCallkeep.setup(); method. But the listener is not working.

Steps to Reproduce

  setUpCallKeep = () => {
    RNCallKeep.setup(callKeepOptions);
    RNCallKeep.setAvailable(true);
    RNCallKeep.addEventListener('didLoadWithEvents', (e) => {
      console.log('Navigation -> e', e);
    });
  };

this listener is not working even if the app was opened by call keep, nor when i accept or reject the call during the JS initialization.

Versions

- Callkeep:^3.1.1
- React Native:0.63.1
- iOS:13.5
- Android: - 
- Phone model: iPhone 7

samad324 avatar Nov 03 '20 09:11 samad324

I've run into it and still did'nt find any solution. please support us. @manuquentin

vuletuan avatar Nov 12 '20 06:11 vuletuan

@manuquentin only the incomingCallDidDisplay event is thrown from native side accept and reject events are not, can you please help on this one?

devWaleed avatar Dec 03 '20 15:12 devWaleed

Please try the latest master. #315 may fixed some cases

zxcpoiu avatar Dec 04 '20 09:12 zxcpoiu

The latest version means 4.0.1 btw

zxcpoiu avatar Dec 04 '20 09:12 zxcpoiu

The latest version means 4.0.1 btw

I updated to the latest version, and still having this issue. Any help would be appreciated.

weijihuang avatar Jan 08 '21 00:01 weijihuang

I am also experiencing this issue. I am running the latest CallKeep release and didLoadWithEvents does not fire at all for me.

rcidt avatar Apr 04 '21 23:04 rcidt

Hi, have you tried this https://github.com/react-native-webrtc/react-native-callkeep/pull/382?

Romick2005 avatar Apr 04 '21 23:04 Romick2005

@Romick2005 I will try this tomorrow, thank you

rcidt avatar Apr 04 '21 23:04 rcidt

I found my issue.

didLoadWithEvents is giving different event names than the eventListeners expect. For example, didDisplayIncomingCall is named RNCallKeepDidDisplayIncomingCall when it comes in via didLoadWithEvents.

I'm not sure if this is intended or not.

rcidt avatar Apr 06 '21 15:04 rcidt

Is it in my fork? Or in the main repo? I have never seen invalid names. Can you please elaborate ob this more?

Romick2005 avatar Apr 06 '21 15:04 Romick2005

@Romick2005 In the main repo. I haven't tested your fork.

For example, when you add an event listener for incoming calls, you set it up with the event name didDisplayIncomingCall

Like CallKeep.addEventListener('didDisplayIncomingCall', callback)

But the name of the event that is returned by didLoadWithEvents is RNCallKeepDidDisplayIncomingCall.

One would assume that the event name would be didDisplayIncomingCall.

rcidt avatar Apr 06 '21 16:04 rcidt

Is that a problem for you? Your initial statement was that no events has been fired at all.

Romick2005 avatar Apr 06 '21 16:04 Romick2005

My initial assumption was incorrect. I thought didLoadWithEvents was not being emitted because I was looking for didDisplayIncomingCall instead of RNCallKeepDidDisplayIncomingCall

rcidt avatar Apr 06 '21 16:04 rcidt

I am also having the same problem. didLoadWithEvents is never emitted...

I did setup iOS in my AppDelegate.m as mentioned here as well as in the documentation, but it still doesn't work.

I tried using RNCallKeep.getInitialEvents(); since it is an alternative to didLoadWithEvents as mentioned here but it's not working too...

Was anyone able to solve this?

Thank you!

MEsteves22 avatar Sep 02 '21 16:09 MEsteves22

Have you tried this

Romick2005 avatar Sep 02 '21 18:09 Romick2005

I was able to make didLoadWithEvents work and I am receiving events. I was doing something wrong while setting up CallKeep. However, I never receive the RNCallKeepPerformEndCallAction event with didLoadWithEvents if I reject the call too quickly. I think it's because the JS side was not able to run and then reject my call.

MEsteves22 avatar Sep 03 '21 16:09 MEsteves22

I think you are right. You should check #418 issue.

Romick2005 avatar Sep 03 '21 18:09 Romick2005

ohh finally got it worked , reload the app from Xcode IDE after made changes don't use React Native Metro Debugger Reload because call back event reference is removed when Metro Debugger reloading the app (it might be bug or event lifecycle ) that's why event is not firing I restart the app every time using Xcode then there is no issue at all , events firing perfectly

mi2arun avatar Dec 30 '21 10:12 mi2arun