Code Monkey home page Code Monkey logo

test's Introduction

ios_callkit

One-to-one video/Audio 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 ios_callkit 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>AppIconName</string>
<key>FIVKLocalizedName</key>
<string>ios_callkit</string>
<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

Create .p12 from .cer with KeyChainAccess

|

openssl pkcs12 -in voip_services.p12 -out voip_services.pem -nodes -clcerts

5. request VoIP notification APNs from your server

{
    "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>,
          "videoType":true,
        }
    }
}
  • You can use curl to test VoIP notifications as follows.
curl -v \
-d '{"aps":{"alert":{"uuid":"982cf533-7b1b-4cf6-a6e0-004aab68c503","incoming_caller_id":"0123456789","incoming_caller_name":"Tester","videoType":true}}}' \
-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>

ios_callkit

test's People

Contributors

officialkunalgandhi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.