Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Changelog

-----------------------------------------------

[0.4.4]
* support for pushkit call interceptor
[0.4.3]
* fix podspec to januscaler_callkeep
[0.4.2]
* added toggle speaker support
* added support for listening PushMessagePayload
[0.4.1] - 2025.02.03

* [Fix] Updates firebase messaging and android gradle
Expand Down
47 changes: 45 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# callkeep

[![Financial Contributors on Open Collective](https://opencollective.com/flutter-webrtc/all/badge.svg?label=financial+contributors)](https://opencollective.com/flutter-webrtc) [![pub package](https://img.shields.io/pub/v/callkeep.svg)](https://pub.dartlang.org/packages/callkeep) [![slack](https://img.shields.io/badge/join-us%20on%20slack-gray.svg?longCache=true&logo=slack&colorB=brightgreen)](https://join.slack.com/t/flutterwebrtc/shared_invite/zt-q83o7y1s-FExGLWEvtkPKM8ku_F8cEQ)
[![januscaler](https://img.shields.io/badge/powered_by-JanuScaler-b?style=for-the-badge&logo=Januscaler&logoColor=%238884ED&label=Powered%20By&labelColor=white&color=%238884ED)](https://januscaler.com)

[![pub package](https://img.shields.io/pub/v/januscaler_callkeep.svg)](https://pub.dartlang.org/packages/januscaler_callkeep)

This is a forked project from [callkeep](https://github.com/flutter-webrtc/callkeep) in an effort to maintain and improve the package for Flutter applications.

- iOS CallKit and Android ConnectionService for Flutter
- Support FCM and PushKit
Expand Down Expand Up @@ -236,6 +240,42 @@ Future<void> closeIncomingCall(
}
```

### iOS PushKit incoming-call gating

iOS VoIP pushes might arrive late or after your call has already ended. To avoid showing stale CallKit UIs, register an interceptor after `setup()` that can inspect the PushKit payload and decide whether CallKit should surface the call:

```dart
final callKeep = FlutterCallkeep();

Future<void> configureCallkeep() async {
await callKeep.setup(
options: {
'ios': {'appName': 'CallKeepDemo'},
'android': {...},
},
);

await callKeep.setPushKitIncomingCallInterceptor(
(payload) async {
final uuid = payload['uuid']?.toString();
if (uuid == null) {
return false; // skip malformed push
}

final alreadyClosed = await callHasEnded(uuid);
return !alreadyClosed; // only display fresh calls
},
timeout: const Duration(seconds: 3),
);
}
```

- Returning `true` allows CallKit to display the incoming call UI.
- Returning `false` skips `reportNewIncomingCall`, preventing a ghost call.
- The optional timeout keeps the UX responsive: if the callback does not finish in time the call is displayed automatically.

Inside the interceptor you can consult your app state, hit your backend, or check any additional payload data before deciding.

Pass in your own dialog UI for permissions alerts

````dart
Expand Down Expand Up @@ -271,8 +311,11 @@ showAlertDialog: () async {


### FAQ
> I don't receive the incoming call in ios
Receiving incoming calls in iOS requires the app to be registered with PushKit and to handle VoIP pushes correctly. Ensure that your app is configured to receive VoIP pushes and that you are using the correct payload format for incoming calls.
also make sure you have not abused the PushKit API, as device may throttle or block your app from receiving VoIP pushes if it detects misuse.

> I don't receive the incoming call
> I don't receive the incoming call(android)

Receiving incoming calls depends on FCM push messages (or the system you use) for handling the call information and displaying it.
Remember FCM push messages not always works due to data-only messages are classified as "low priority". Devices can throttle and ignore these messages if your application is in the background, terminated, or a variety of other conditions such as low battery or currently high CPU usage. To help improve delivery, you can bump the priority of messages. Note; this does still not guarantee delivery. More info [here](https://firebase.flutter.dev/docs/messaging/usage/#low-priority-messages)
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:8.3.0'
}
}

Expand Down
Loading