Skip to content

Call automatically ending right after calling startCall method #203

@Gabriellsp

Description

@Gabriellsp

Hello, when calling the startCall method, the call appears and then closes on Android! Has anyone experienced this? I'm using version 0.4.1 of CallKeep.

If anyone can help me, I would appreciate it!

Code:
extension = "301";
lastCallUUID = const Uuid().v4();
await _callKeep!.startCall(
uuid: lastCallUUID,
handle: extension,
callerName: "Teste som teste",
);

Setup:
Future initCallkeep() async {
print('[CallkeepHelper] didDisplayIncomingCall-> initCallkeep chamado!');
if (!_callKeepInitialized) {
_callKeep!
.on(_callkeepDidDisplayIncomingCall);
_callKeep!.on(_callkeepAnswerCall);
_callKeep!.on(
_callkeepDidReceiveStartCallAction);
_callKeep!
.on(_callkeepDidToggleHoldCallAction);

  _callKeep!.on<CallKeepDidPerformSetMutedCallAction>(
      _callkeepDidPerformSetMutedCallAction);
  _callKeep!.on<CallKeepPerformEndCallAction>(_callkeepEndCall);
  _callKeep!.on<CallKeepPerformRejectCallAction>(_callkeepRejectCall);

  _callKeep!.on<CallKeepPushKitToken>(_callkeepOnPushKitToken);
  _callKeep!.on<CallKeepDidPerformSetMutedCallAction>((state) {
    try {
      _callMutedController.sink.add(state.muted ?? false);
    } catch (e) {
      print(
          "Falha ao emitir um estado em CallKeepDidPerformSetMutedCallAction");
    }
  });

  await _callKeep!.setup(
    showAlertDialog: () async {
      return true;
    },
    options: CallkeepOptionFactory.getOptions(channelId),
    backgroundMode: true,
  );

  _callKeep!.setForegroundServiceSettings(settings: {
    'channelId': 'br.com.condiminioautonomo',
    'channelName': 'Foreground service for APP',
    'notificationTitle': 'APP is running on background',
    'notificationBody': 'Toque para voltar à chamada',
    'color': '#4CAF50',
    'bringToForeground': "true",
  });
  _callKeepInitialized = true;

  await _callKeep!.setAvailable(available: true);
  await _callKeep!.setReachable(reachable: true);
  print('[CallkeepHelper] Callkeep Initialized');
} else {
  print('[CallkeepHelper] Callkeep Already Initialized');
}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions