callkeep icon indicating copy to clipboard operation
callkeep copied to clipboard

CallKeepPerformAnswerCallAction Called Twice

Open rlee1990 opened this issue 4 years ago • 2 comments

I have noticed that CallKeepPerformAnswerCallAction is being called twice if another call is made without either closing the application or restarting the application. This so far has been tested on android and it causes the app to push the same route twice.

rlee1990 avatar Aug 31 '21 15:08 rlee1990

+1 we're getting this issue as well

ejimenez93 avatar Sep 02 '21 14:09 ejimenez93

What I did as a workaround @ejimenez93 was this

_callkeep.on(CallKeepPerformAnswerCallAction(),
                (CallKeepPerformAnswerCallAction event) {
                  if (!showCall) {
                    print("called from tab");
                    if (Platform.isAndroid) {
                _callkeep.endAllCalls();
              }
                  final channel =
                  SNAB.streamChatClient.channel('message', id: callerId);
              AutoRouter.of(context).push(ChatVideoCallRoute(
                  channel: channel, uid: callerId, isIncoming: true));
              
              setState(() {
                showCall = true;
              });
                  }
                  Future.delayed(Duration(seconds: 1)).then((value) {
                    setState(() {
                      showCall = false;
                    });
                  });
            });

rlee1990 avatar Sep 02 '21 14:09 rlee1990