Skip to content

The Handler not working in the killed state [CallKeep.instance.handler = CallEventHandler()] #72

@radyhaggag

Description

@radyhaggag

The listener not working when app is terminated in the new version, and in the last version was working fine, but in the last days stopped from working.

  static Future<void> onAppStart(
    BuildContext context,
  ) async {
    await checkAndNavigationCallingPage();

    CallKeep.instance.handler = CallEventHandler(
      onCallIncoming: (event) {
        final callParams = AgoraCallModel.fromNotificationData(
          event.toMap()["extra"],
        );
        activateIncomingCallListener(
          callParams.channelName,
          event.uuid,
        );
      },
      onCallAccepted: (event) {
        final callParams = AgoraCallModel.fromNotificationData(
          event.toMap()["extra"],
        );
        return _onCallAccepted(
          context,
          callParams: callParams,
        );
      },
      onCallDeclined: (event) {
        //todo: add a callback when the call is rejected
        final callParams = AgoraCallModel.fromNotificationData(
          event.toMap()["extra"],
        );
        return _onCallRejected(
          context,
          callParams: callParams,
        );
      },
    );
  }


and i call this method in the initstate for the app.dart file

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions