一个 Flutter 包,可在 iOS 上使用 CallKit 和 PushKit 实现一对一视频通话,无缝集成系统原生拨号界面。它支持来电通知、后台处理以及原生般的通话体验。该包专为 iOS 设计,利用平台特定 API 确保可靠的实时通信。虽然其配置支持 Android,但核心功能聚焦于 iOS。需要正确设置 VoIP 推送证书和后端推送通知支持。
适合场景
实时视频通话应用
iOS 原生通话体验
后台调用处理
基于推送的呼叫发起
与 CallKit UI 集成
主要特点
CallKit 集成
PushKit 支持
后台调用功能
原生 iOS 调用接口
VoIP推送通知处理
适合对象
专注于iOS的视频通话应用
需要系统级调用集成的应用程序
开发远程医疗或消息传递平台的开发者
需要后台调用持久性的项目
使用建议
需要 iOS 独有的配置
需要 VoIP 推送证书设置
需要后端推送通知服务
有限的 Android 功能
与 Apple 开发者门户的复杂初始设置
原始 README
以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。
flutter_ios_voip_kit
One-to-one video call using CallKit and PushKit with flutter iOS app.
Motivation
We need to use CallKit to handle incoming VoIP notifications from iOS 13. Check the WWDC2019 video for more information. So instead of using CallKit and PushKit separately, there is a growing need to use them together. However, there are still few VoIP notification samples on the net that use CallKit and PushKit (especially for Flutter). I decided to create a flutter plugin with the minimum required functions. You can use this plugin, but the actual purpose is to help you create a VoIPKit tailored to your service.
Requirement
iOS only, not support Android.
iOS 10 or above.
one-to-one call only, not support group call.
need to a server for pushing VoIP notification with APNs.
to actually make a video or call, you need to link to a service such as WebRTC(ex: Agora, SkyWay, Amazon Kinesis Video Streams).
Usage
1. install
Add flutter_ios_voip_kit as a dependency in your pubspec.yaml file.
2. setting Capability in Xcode
Select Background Modes > Voice over IP and Remote notifications is ON.
Select Push Notifications.
Changed ios/Runner/Info.plist after selected Capability.
Does CallKit have a call and outgoing call screen?
No. CallKit support incoming call screen only. You need to make your own a call and outgoing call screens.
Can I use remote push device token instead of VoIP device token?
No. Since the specifications of VoIP token and push token are different, it is necessary to manage them separately in your database.
Can't get VoIP token on iOS13
Please uninstall the app, restart the terminal and reinstall the app. You can get it after a while.
Don't receive VoIP notifications
Please check the following items.
Is the VoIP device token correct?
Did you set your app’s bundle ID with .voip to apns-topic?
Did you set voip to apns-push-type?
Is the APNs endpoint(Development or Production) correct?
For iOS13, VoIP notifications may not be received if call kit call fails many times. Please uninstall the app, restart the terminal and reinstall the app.
No icon is displayed on the incoming call screen when locked
The icon image should be a square with side length of 40 points. The color is ignored. Please design with the difference of alpha.
If created in PDF, checked Preserve Vector Data for Resizing and change Single Scale for Scales.