flutter_ios_voip_kit
使用 CallKit 和 PushKit 的 Flutter iOS 應用程式實現一對一視訊通話。
使用 CallKit 和 PushKit 的 Flutter iOS 應用實現一對一視訊通話。
{"sdk":"flutter"}{"sdk":"flutter"}以下為英文專案原文快照,最新內容請造訪 GitHub。
One-to-one video call using CallKit and PushKit with flutter iOS app.
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.
flutter_ios_voip_kit as a dependency in your pubspec.yaml file.ios/Runner/Info.plist after selected Capability.<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
<string>voip</string>
</array>
ios/Runner/Info.plist as below.<key>FIVKIconName</key>
<string>AppIcon-VoIPKit</string>
<key>FIVKLocalizedName</key>
<string>VoIP-Kit</string>
<key>FIVKSupportVideo</key>
<true/>
<key>FIVKSkipRecallScreen</key>
<true/>
ios/Runner/Assets.xcassets/AppIcon-VoIPKit to use on the screen when a call comes in while locked iPhone..cer). Check Voice Over IP (VoIP) Best Practices Figure 11-2 for more information..p12 from .cer with KeyChainAccess, and .pem with openssl.Create .p12 from .cer with KeyChainAccess |
|---|
| https://user-images.githubusercontent.com/6649643/88076945-aa9a9d00-cbb5-11ea-9309-5f7f7df8d3b5.png |
openssl pkcs12 -in voip_services.p12 -out voip_services.pem -nodes -clcerts
If you're running OpenSSL version 3 or later, please note that you may need to include the "-legacy" option.
openssl pkcs12 -legacy -in voip_services.p12 -out voip_services.pem -nodes -clcerts
{
"aps": {
"alert": {
"uuid": <Version 4 UUID (e.g.: https://www.uuidgenerator.net/version4) >,
"incoming_caller_id": <your service user id>,
"incoming_caller_name": <your service user name>,
}
}
}
curl -v \
-d '{"aps":{"alert":{"uuid":"982cf533-7b1b-4cf6-a6e0-004aab68c503","incoming_caller_id":"0123456789","incoming_caller_name":"Tester"}}}' \
-H "apns-push-type: voip" \
-H "apns-expiration: 0" \
-H "apns-priority: 0" \
-H "apns-topic: <your app’s bundle ID>.voip" \
--http2 \
--cert ./voip_services.pem \
https://api.sandbox.push.apple.com/3/device/<VoIP device Token for your iPhone>
| Select call role | 🤙 Caller page | 🔔 Callee page |
|---|---|---|
| https://user-images.githubusercontent.com/6649643/87527220-c5a57280-c6c6-11ea-9357-434d13617e77.png | https://user-images.githubusercontent.com/6649643/87527233-c9d19000-c6c6-11ea-8bad-892cb1763189.png | https://user-images.githubusercontent.com/6649643/87527237-cb02bd00-c6c6-11ea-9eb6-0120e3bd800e.png |
| 🔔 Callee(incoming call) | 🔔 Callee(locked) | 🔔 Callee(locked) | 🔔 Callee(recall) |
|---|---|---|---|
| https://user-images.githubusercontent.com/6649643/87534922-a829d600-c6d1-11ea-8190-19441e6bec69.png | https://user-images.githubusercontent.com/6649643/88077993-df5b2400-cbb6-11ea-8730-d7c28def7366.png | https://user-images.githubusercontent.com/6649643/88077978-db2f0680-cbb6-11ea-8777-9f1e59cee987.png | https://user-images.githubusercontent.com/6649643/87549570-f4ccdb80-c6e8-11ea-95cc-179c2b633464.png |
| 🔔 Callee(unanswered local notification) | 🔔 Callee(unanswered local notification) |
|---|---|
| https://user-images.githubusercontent.com/6649643/87621935-ed471a00-c75c-11ea-988c-d4e3bbac798e.png | https://user-images.githubusercontent.com/6649643/87621936-ee784700-c75c-11ea-8260-9a290a0b62ec.png |
.voip to apns-topic?voip to apns-push-type?Preserve Vector Data for Resizing and change Single Scale for Scales.| create icon (e.g.: sketch) | Xcode Image Set |
|---|---|
| https://user-images.githubusercontent.com/6649643/88074708-b8025800-cbb2-11ea-9a69-3365766ff3f4.png | https://user-images.githubusercontent.com/6649643/88073817-9785ce00-cbb1-11ea-8a62-8b68276d9209.png |