flutter_ios_voip_kit 0.0.1 copy "flutter_ios_voip_kit: ^0.0.1" to clipboard
flutter_ios_voip_kit: ^0.0.1 copied to clipboard

outdated

One-to-one video call using CallKit and PushKit with flutter ios app.

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 #

  1. Select Background Modes > Voice over IP and Remote notifications is ON.
  2. Select Push Notifications.
  3. Changed ios/Runner/Info.plist after selected Capability.
<key>UIBackgroundModes</key>
<array>
    <string>remote-notification</string>
    <string>voip</string>
</array>

2. edit Info.plist #

  • Edit 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/>

3. add New Image set for CallKit #

  • Add an icon(.png or .pdf) ios/Runner/Assets.xcassets/AppIcon-VoIPKit to use on the screen when a call comes in while locked iPhone.

4. create VoIP Services Certificate #

5. request VoIP notification APNs from your server #

{
    "aps": {
        "alert": {
          "rtc_channel_id": <WebRTC service provides stream channel id>,
          "incoming_caller_id": <your service user id>,
          "incoming_caller_name": <your service user name>,
        }
    }
}

Try out example app #

  • It is possible to try the example app with some features without a server.
Select call role 🤙 Caller page 🔔 Callee page
🔔 Callee(incoming call) 🔔 Callee(incoming call locked) 🔔 Callee(recall)
🔔 Callee(unanswered local notification) 🔔 Callee(unanswered local notification)

Q&A #

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.
    1. Is the VoIP device token correct?
    2. Did you set your app’s bundle ID with .voip to apns-topic?
    3. Did you set voip to apns-push-type?
    4. Is the APNs endpoint(Development or Production) correct?
    5. 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.

Reference #

46
likes
0
pub points
71%
popularity

Publisher

unverified uploader

One-to-one video call using CallKit and PushKit with flutter ios app.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_ios_voip_kit