voximplant / flutter_callkit

Flutter SDK for CallKit integration to Flutter applications on iOS
MIT License
53 stars 18 forks source link

VoIP call #3

Closed NarHakobyan closed 4 years ago

NarHakobyan commented 4 years ago

Hi, thanks for good lib, I need help with voip and incoming call, where am I need to put didDisplayIncomingCall function to receive call when app is closed? I checked example but didn't found anything related to that

VladimirBrejcha commented 4 years ago

Hi,

didDisplayIncomingCall is fired immediately after CallKit processes a push from the native code and opens its UI with an incoming call. So In the dart code you should to set this callback as early as possible (because it will be called very soon after app start)

About receiving a call when the app is closed:

  1. You'll need voip pushes set up
  2. You'll need to notify callKit in iOS native code about incoming call as showed in the readme
  3. CallKit UI will be showed up
  4. didDisplayIncomingCall will be called in dart code
NarHakobyan commented 4 years ago

Thanks for the fast reply, am I need to set it before run() function?

and will this show callKit UI?

FlutterCallkitPlugin.reportNewIncomingCall(
            with: uuid,
            callUpdate: callUpdate,
            providerConfiguration: configuration,
            pushProcessingCompletion: completion
)
VladimirBrejcha commented 4 years ago

It might work if you set it later, but not guaranteed. So, if it is possible, set this callback before runApp()

about the second question: correct, this will show callKit UI