Giter Club home page Giter Club logo

callkeep's Introduction

Flutter-WebRTC

Financial Contributors on Open Collective pub package Gitter slack

WebRTC plugin for Flutter Mobile/Desktop/Web


Sponsored with 💖   by
Stream Chat
Enterprise Grade APIs for Feeds, Chat, & Video. Try the Flutter Video tutorial 💬


LiveKit
LiveKit - Open source WebRTC infrastructure

Functionality

Feature Android iOS Web macOS Windows Linux Embedded Fuchsia
Audio/Video ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ [WIP]
Data Channel ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ [WIP]
Screen Capture ✔️ ✔️(*) ✔️ ✔️ ✔️ ✔️ [WIP]
Unified-Plan ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ [WIP]
Simulcast ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ [WIP]
MediaRecorder ⚠️ ⚠️ ✔️
End to End Encryption ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Insertable Streams

Additional platform/OS support from the other community

Add flutter_webrtc as a dependency in your pubspec.yaml file.

iOS

Add the following entry to your Info.plist file, located in <project root>/ios/Runner/Info.plist:

<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) Camera Usage!</string>
<key>NSMicrophoneUsageDescription</key>
<string>$(PRODUCT_NAME) Microphone Usage!</string>

This entry allows your app to access camera and microphone.

Note for iOS.

The WebRTC.xframework compiled after the m104 release no longer supports iOS arm devices, so need to add the config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES' to your ios/Podfile in your project

ios/Podfile

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
     target.build_configurations.each do |config|
      # Workaround for https://github.com/flutter/flutter/issues/64502
      config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES' # <= this line
     end
  end
end

Android

Ensure the following permission is present in your Android Manifest file, located in <project root>/android/app/src/main/AndroidManifest.xml:

<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

If you need to use a Bluetooth device, please add:

<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" />

The Flutter project template adds it, so it may already be there.

Also you will need to set your build settings to Java 8, because official WebRTC jar now uses static methods in EglBase interface. Just add this to your app level build.gradle:

android {
    //...
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

If necessary, in the same build.gradle you will need to increase minSdkVersion of defaultConfig up to 23 (currently default Flutter generator set it to 16).

Important reminder

When you compile the release apk, you need to add the following operations, Setup Proguard Rules

Contributing

The project is inseparable from the contributors of the community.

Example

For more examples, please refer to flutter-webrtc-demo.

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

callkeep's People

Contributors

cloudwebrtc avatar efraespada avatar krille-chan avatar mouesam avatar pierre-monier avatar quango2304 avatar renovate-bot avatar renovate[bot] avatar ruichen0101 avatar ryojiro avatar shomatan avatar simone-folador avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

callkeep's Issues

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

Unhandled Exception: MissingPluginException(No implementation found for method setup on channel FlutterCallKeep.Method)

Hi, I m testing example app of plugin. everything works fine when app is foreground but when app is in backround I am getting error below.

my firebase message payload is :

{
	"registration_ids":["d08bLhJpQn6-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3FGiY-"
],
	"data":{ "uuid": "xxxxx-xxxxx-xxxxx-xxxxx",
    "caller_id": "+8618612345678",
    "caller_name": "hello",
    "caller_id_type": "number", 
    "has_video": false}
	
}

Error message:

/flutter (18141): backgroundMessage: message => {data: {caller_id: +8618612345678, uuid: xxxxx-xxxxx-xxxxx-xxxxx, has_video: false, caller_id_type: number, caller_name: hello}}
I/flutter (18141): backgroundMessage: displayIncomingCall (+8618612345678)
E/flutter (18141): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method displayIncomingCall on channel FlutterCallKeep.Method)
E/flutter (18141): #0      MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:157
E/flutter (18141): <asynchronous suspension>
E/flutter (18141): #1      MethodChannel.invokeMethod
package:flutter/…/services/platform_channel.dart:332
E/flutter (18141): #2      FlutterCallkeep.displayIncomingCall
package:callkeep/src/api.dart:83
E/flutter (18141): #3      myBackgroundMessageHandler
package:callkit/main.dart:81
E/flutter (18141): #4      _fcmSetupBackgroundChannel.<anonymous closure>
package:firebase_messaging/firebase_messaging.dart:38
E/flutter (18141): #5      MethodChannel._handleAsMethodCall
package:flutter/…/services/platform_channel.dart:430
E/flutter (18141): #6      MethodChannel.setMethodCallHandler.<anonymous closure>
package:flutter/…/services/platform_channel.dart:383
E/flutter (18141): #7      _DefaultBinaryMessenger.handlePlatformMessage
package:flutter/…/services/binding.dart:283
E/flutter (18141): #8      _invoke3.<anonymous closure> (dart:ui/hooks.dart:280:15)
E/flutter (18141): #9      _rootRun (dart:async/zone.dart:1190:13)
E/flutter (18141): #10     _CustomZone.run (dart:async/zone.dart:1093:19)
E/flutter (18141): #11     _CustomZone.runGuarded (dart:async/zone.dart:997:7)
E/flutter (18141): #12     _invoke3 (dart:ui/hooks.dart:279:10)
E/flutter (18141): #13     _dispatchPlatformMessage (dart:ui/hooks.dart:154:5)
E/flutter (18141):
E/flutter (18141): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method backToForeground on channel FlutterCallKeep.Method)
E/flutter (18141): #0      MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:157
E/flutter (18141): <asynchronous suspension>
E/flutter (18141): #1      MethodChannel.invokeMethod
package:flutter/…/services/platform_channel.dart:332
E/flutter (18141): #2      FlutterCallkeep.backToForeground
package:callkeep/src/api.dart:260
E/flutter (18141): #3      myBackgroundMessageHandler
E/flutter (18141): #4      _fcmSetupBackgroundChannel.<anonymous closure>
package:firebase_messaging/firebase_messaging.dart:38
E/flutter (18141): #5      _fcmSetupBackgroundChannel.<anonymous closure>
package:firebase_messaging/firebase_messaging.dart:31
E/flutter (18141): #6      MethodChannel._handleAsMethodCall
package:flutter/…/services/platform_channel.dart:430
E/flutter (18141): #7      MethodChannel.setMethodCallHandler.<anonymous closure>
package:flutter/…/services/platform_channel.dart:383
E/flutter (18141): #8      _DefaultBinaryMessenger.handlePlatformMessage
package:flutter/…/services/binding.dart:283
E/flutter (18141): #9      _invoke3.<anonymous closure> (dart:ui/hooks.dart:280:15)
E/flutter (18141): #10     _rootRun (dart:async/zone.dart:1190:13)
E/flutter (18141): #11     _CustomZone.run (dart:async/zone.dart:1093:19)
E/flutter (18141): #12     _CustomZone.runGuarded (dart:async/zone.dart:997:7)
E/flutter (18141): #13     _invoke3 (dart:ui/hooks.dart:279:10)
E/flutter (18141): #14     _dispatchPlatformMessage (dart:ui/hooks.dart:154:5)

I tried it samsung galaxy j6+ android 10

any idea will be appriciated.

Could not find androidx.legacy:legacy-support-v4:27.1.1

Hi,
My application cant be run when I want to run on android platform after adding callkeep . I am getting error below. I have no problem with example app to run but when I want to implement it to my I am getting error.
maybe its not call keep related problem but I have no idea how to solve it. thanks for concern.

Launching lib/main.dart on SM J610F in debug mode...
 lib/main.dart
Plugin project :location_web not found. Please update settings.gradle.

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:processDebugResources'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not find androidx.legacy:legacy-support-v4:27.1.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.pom
       - https://dl.google.com/dl/android/maven2/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.jar
       - https://jcenter.bintray.com/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.pom
       - https://jcenter.bintray.com/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.jar
       - https://storage.googleapis.com/download.flutter.io/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.pom
       - https://storage.googleapis.com/download.flutter.io/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.jar
       - https://repo.maven.apache.org/maven2/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.pom
       - https://repo.maven.apache.org/maven2/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.jar
       - https://maven.google.com/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.pom
       - https://maven.google.com/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.jar
       - https://google.bintray.com/exoplayer/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.pom
       - https://google.bintray.com/exoplayer/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.jar
     Required by:
         project :app > project :callkeep
   > Could not find androidx.appcompat:appcompat:27.1.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.pom
       - https://dl.google.com/dl/android/maven2/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.jar
       - https://jcenter.bintray.com/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.pom
       - https://jcenter.bintray.com/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.jar
       - https://storage.googleapis.com/download.flutter.io/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.pom
       - https://storage.googleapis.com/download.flutter.io/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.jar
       - https://repo.maven.apache.org/maven2/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.pom
       - https://repo.maven.apache.org/maven2/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.jar
       - https://maven.google.com/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.pom
       - https://maven.google.com/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.jar
       - https://google.bintray.com/exoplayer/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.pom
       - https://google.bintray.com/exoplayer/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.jar
     Required by:
         project :app > project :callkeep
   > Could not find androidx.legacy:legacy-support-core-utils:27.1.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.pom
       - https://dl.google.com/dl/android/maven2/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.jar
       - https://jcenter.bintray.com/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.pom
       - https://jcenter.bintray.com/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.jar
       - https://storage.googleapis.com/download.flutter.io/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.pom
       - https://storage.googleapis.com/download.flutter.io/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.jar
       - https://repo.maven.apache.org/maven2/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.pom
       - https://repo.maven.apache.org/maven2/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.jar
       - https://maven.google.com/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.pom
       - https://maven.google.com/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.jar
       - https://google.bintray.com/exoplayer/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.pom
       - https://google.bintray.com/exoplayer/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.jar
     Required by:
         project :app > project :callkeep


also below error occurs when add call kep to project

> Could not find androidx.legacy:legacy-support-v4:27.1.1.
   Searched in the following locations:
     - https://dl.google.com/dl/android/maven2/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.pom
     - https://dl.google.com/dl/android/maven2/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.jar
     - https://jcenter.bintray.com/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.pom
     - https://jcenter.bintray.com/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.jar
     - https://storage.googleapis.com/download.flutter.io/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.pom
     - https://storage.googleapis.com/download.flutter.io/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.jar
     - https://repo.maven.apache.org/maven2/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.pom
     - https://repo.maven.apache.org/maven2/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.jar
     - https://maven.google.com/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.pom
     - https://maven.google.com/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.jar
     - https://google.bintray.com/exoplayer/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.pom
     - https://google.bintray.com/exoplayer/androidx/legacy/legacy-support-v4/27.1.1/legacy-support-v4-27.1.1.jar
   Required by:
       project :app > project :open_file
 > Could not find androidx.appcompat:appcompat:27.1.1.
   Searched in the following locations:
     - https://dl.google.com/dl/android/maven2/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.pom
     - https://dl.google.com/dl/android/maven2/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.jar
     - https://jcenter.bintray.com/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.pom
     - https://jcenter.bintray.com/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.jar
     - https://storage.googleapis.com/download.flutter.io/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.pom
     - https://storage.googleapis.com/download.flutter.io/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.jar
     - https://repo.maven.apache.org/maven2/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.pom
     - https://repo.maven.apache.org/maven2/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.jar
     - https://maven.google.com/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.pom
     - https://maven.google.com/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.jar
     - https://google.bintray.com/exoplayer/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.pom
     - https://google.bintray.com/exoplayer/androidx/appcompat/appcompat/27.1.1/appcompat-27.1.1.jar
   Required by:
       project :app > project :local_auth > androidx.biometric:biometric:1.0.0-beta01
 > Could not find androidx.legacy:legacy-support-core-utils:27.1.1.
   Searched in the following locations:
     - https://dl.google.com/dl/android/maven2/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.pom
     - https://dl.google.com/dl/android/maven2/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.jar
     - https://jcenter.bintray.com/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.pom
     - https://jcenter.bintray.com/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.jar
     - https://storage.googleapis.com/download.flutter.io/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.pom
     - https://storage.googleapis.com/download.flutter.io/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.jar
     - https://repo.maven.apache.org/maven2/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.pom
     - https://repo.maven.apache.org/maven2/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.jar
     - https://maven.google.com/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.pom
     - https://maven.google.com/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.jar
     - https://google.bintray.com/exoplayer/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.pom
     - https://google.bintray.com/exoplayer/androidx/legacy/legacy-support-core-utils/27.1.1/legacy-support-core-utils-27.1.1.jar
   Required by:
       project :app > project :firebase_messaging > com.google.firebase:firebase-messaging:20.3.0 > com.google.android.gms:play-services-stats:17.0.0
       project :app > project :firebase_messaging > com.google.firebase:firebase-messaging:20.3.0 > com.google.firebase:firebase-iid:20.3.0
       project :app > project :firebase_core > com.google.firebase:firebase-core:17.5.1 > com.google.firebase:firebase-analytics:17.6.0 > com.google.android.gms:play-services-measurement:17.6.0

How to customize answering incoming call ?

Hi,

I have two questions.

  1. How to remove dialing pad screen after click on answer button ? Because i want to open the app with new screen.
  2. How to open the app when click on answer button if app is in background mode ?

I am using custom calling, but phone number based call. Whenever receiver gets the call, i am using this package to notify the user for incoming call. When user clicks on answer button, i want to open the app (if it is in background) and show some screen. So i dont want keypad screen.

Please help me on this.

startCall() erroring on checkPermission

On Android, when receiving a push notification and answering the call it attempts to run android.content.Context.checkPermission(). This causes a crash due to there not being a usable this._currentActivity with the app initializing from background push.

Steps to reproduce:

  1. Close app, lock screen, and wait 5 minutes (performing sooner seems to work normally)
  2. Initiate callkeep by sending a push notification.
  3. Answer the incoming call
  4. Unhandled Exception will be thrown on startCall() but will display answered call.

All permission has been granted before and initiating from push notification with SIP registration is working correctly.

2020-12-28 16:34:39.001 9712-9712/com.example.app E/MethodChannel#FlutterCallKeep.Method: Failed to handle method call java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Context.checkPermission(java.lang.String, int, int)' on a null object reference at androidx.core.content.ContextCompat.checkSelfPermission(ContextCompat.java:535) at io.wazo.callkeep.CallKeepModule.hasPermissions(CallKeepModule.java:613) at io.wazo.callkeep.CallKeepModule.startCall(CallKeepModule.java:281) at io.wazo.callkeep.CallKeepModule.HandleMethodCall(CallKeepModule.java:123) at com.github.cloudwebrtc.flutter_callkeep.FlutterCallkeepPlugin.onMethodCall(FlutterCallkeepPlugin.java:69) at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233) at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692) at android.os.MessageQueue.nativePollOnce(Native Method) at android.os.MessageQueue.next(MessageQueue.java:335) at android.os.Looper.loop(Looper.java:183) at android.app.ActivityThread.main(ActivityThread.java:7660) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 2020-12-28 16:34:39.005 9712-9760/com.example.app E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'int android.content.Context.checkPermission(java.lang.String, int, int)' on a null object reference, null, java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Context.checkPermission(java.lang.String, int, int)' on a null object reference at androidx.core.content.ContextCompat.checkSelfPermission(ContextCompat.java:535) at io.wazo.callkeep.CallKeepModule.hasPermissions(CallKeepModule.java:613) at io.wazo.callkeep.CallKeepModule.startCall(CallKeepModule.java:281) at io.wazo.callkeep.CallKeepModule.HandleMethodCall(CallKeepModule.java:123) at com.github.cloudwebrtc.flutter_callkeep.FlutterCallkeepPlugin.onMethodCall(FlutterCallkeepPlugin.java:69) at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233) at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692) at android.os.MessageQueue.nativePollOnce(Native Method) at android.os.MessageQueue.next(MessageQueue.java:335) at android.os.Looper.loop(Looper.java:183) at android.app.ActivityThread.main(ActivityThread.java:7660) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

CallKeepDidDisplayIncomingCall doesn't trigger

Application state - foreground

This is my configuration:

_callKeep.on(CallKeepPerformAnswerCallAction(), answerCall);
_callKeep.on(CallKeepDidPerformDTMFAction(), didPerformDTMFAction);
_callKeep.on(CallKeepDidReceiveStartCallAction(), didReceiveStartCallAction);
_callKeep.on(CallKeepDidToggleHoldAction(), didToggleHoldCallAction);
_callKeep.on(CallKeepDidDisplayIncomingCall(), didDisplayIncomingCall);
_callKeep.on(CallKeepDidPerformSetMutedCallAction(), didPerformSetMutedCallAction);
_callKeep.on(CallKeepPerformEndCallAction(), endCall);
_callKeep.setup(<String, dynamic>{
  'ios': {
    'appName': 'Example',
  },
  'android': {
    'alertTitle': 'Permissions required',
    'alertDescription':
        'This application needs to access your phone accounts',
    'cancelButton': 'Cancel',
    'okButton': 'ok',
  },
});

My didDisplayIncomingCall method

Future didDisplayedIncomingCall(
CallKeepDidDisplayIncomingCall event) async {
print("didDisplayedIncomingCall");
}

My logs:

INFO: received event "CallKeepDidDisplayIncomingCall" {handle: 19542129277, hasVideo: 0, localizedCallerName: 19542129277_509175, payload: , callUUID: 78A32447-DF18-4399-AB72-09EFFF5FB039, fromPushKit: 1, error: }
received event "CallKeepPerformAnswerCallAction" {callUUID: 78a32447-df18-4399-ab72-09efff5fb039}
CallKeepPerformAnswerCallAction - triggered as well on dart side, but CallKeepDidDisplayIncomingCall not triggered at all

IOS How to launch application on answering call

Hi!

When application is in background mode and we displayIncomingCall, when user taps "Answer", I want to launch application(as flutter_local_notification plugin does on interacting with user).
There is solution for Android - backToForeground, how can it be implemented for IOS?

Thank you

Call accept and reject not working while app in closed.

I have configured FCM onBackgroundMessage: myBackgroundMessageHandler. When app is closed/killed
on new notification it can display incoming call . But when I tried to accept the call , noting happened. on CallKeepPerformAnswerCallAction It should woke up the app and should execute CallKeepPerformAnswerCallAction call back. But it doesn't !
NB: I am working with agora SDK. So After accept the call, I want transfer the control to flutter side.

Another thing .. When I received a call, I create a call log on phone's native dialer, is it possible to hide?

JSON details and extra fields

In the JSON payload, what do we do with badge?

Can we change number to caller_id or from_number and an extra field called to_number so we know what number they caller called?

{
   "aps":{
      "alert":{
         "callkeep":{
            "title":"Incoming call",
            "number":"01224900123"
         },
         "badge":{
            "badge":"0"
         }
      }
   }
}

Hi, When the background fcm arrives to device, it opens the apps home screen, not showing incoming call at all

I/flutter ( 9852): backgroundMessage: message => {data: {caller_id: +8618612345678, type: VIDEO_CALL, uuid: xxxxx-xxxxx-xxxxx-xxxxx, has_video: true, caller_id_type: number, caller_name: hello}}
D/RNCK:VoiceConnectionService( 9852): setAvailable: false
E/MethodChannel#FlutterCallKeep.Method( 9852): Failed to handle method call
E/MethodChannel#FlutterCallKeep.Method( 9852): java.lang.SecurityException: PhoneAccount connection service requires BIND_TELECOM_CONNECTION_SERVICE permission.
E/MethodChannel#FlutterCallKeep.Method( 9852): at android.os.Parcel.createExceptionOrNull(Parcel.java:2373)
E/MethodChannel#FlutterCallKeep.Method( 9852): at android.os.Parcel.createException(Parcel.java:2357)
E/MethodChannel#FlutterCallKeep.Method( 9852): at android.os.Parcel.readException(Parcel.java:2340)
E/MethodChannel#FlutterCallKeep.Method( 9852): at android.os.Parcel.readException(Parcel.java:2282)
E/MethodChannel#FlutterCallKeep.Method( 9852): at com.android.internal.telecom.ITelecomService$Stub$Proxy.registerPhoneAccount(ITelecomService.java:1972)
E/MethodChannel#FlutterCallKeep.Method( 9852): at android.telecom.TelecomManager.registerPhoneAccount(TelecomManager.java:1317)
E/MethodChannel#FlutterCallKeep.Method( 9852): at io.wazo.callkeep.CallKeepModule.registerPhoneAccount(CallKeepModule.java:599)
E/MethodChannel#FlutterCallKeep.Method( 9852): at io.wazo.callkeep.CallKeepModule.registerPhoneAccount(CallKeepModule.java:233)
E/MethodChannel#FlutterCallKeep.Method( 9852): at io.wazo.callkeep.CallKeepModule.setup(CallKeepModule.java:221)
E/MethodChannel#FlutterCallKeep.Method( 9852): at io.wazo.callkeep.CallKeepModule.HandleMethodCall(CallKeepModule.java:108)
E/MethodChannel#FlutterCallKeep.Method( 9852): at com.github.cloudwebrtc.flutter_callkeep.FlutterCallkeepPlugin.onMethodCall(FlutterCallkeepPlugin.java:69)
E/MethodChannel#FlutterCallKeep.Method( 9852): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/MethodChannel#FlutterCallKeep.Method( 9852): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#FlutterCallKeep.Method( 9852): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
E/MethodChannel#FlutterCallKeep.Method( 9852): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#FlutterCallKeep.Method( 9852): at android.os.MessageQueue.next(MessageQueue.java:335)
E/MethodChannel#FlutterCallKeep.Method( 9852): at android.os.Looper.loop(Looper.java:183)
E/MethodChannel#FlutterCallKeep.Method( 9852): at android.app.ActivityThread.main(ActivityThread.java:7656)
E/MethodChannel#FlutterCallKeep.Method( 9852): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#FlutterCallKeep.Method( 9852): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/MethodChannel#FlutterCallKeep.Method( 9852): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
E/MethodChannel#FlutterCallKeep.Method( 9852): Caused by: android.os.RemoteException: Remote stack trace:
E/MethodChannel#FlutterCallKeep.Method( 9852): at com.android.server.telecom.PhoneAccountRegistrar.registerPhoneAccount(PhoneAccountRegistrar.java:776)
E/MethodChannel#FlutterCallKeep.Method( 9852): at com.android.server.telecom.TelecomServiceImpl$1.registerPhoneAccount(TelecomServiceImpl.java:536)
E/MethodChannel#FlutterCallKeep.Method( 9852): at com.android.internal.telecom.ITelecomService$Stub.onTransact(ITelecomService.java:922)
E/MethodChannel#FlutterCallKeep.Method( 9852): at android.os.Binder.execTransactInternal(Binder.java:1154)
E/MethodChannel#FlutterCallKeep.Method( 9852): at android.os.Binder.execTransact(Binder.java:1123)
E/MethodChannel#FlutterCallKeep.Method( 9852):
D/FLT:CallKeepModule( 9852): backToForeground, app isOpened ?true
E/flutter ( 9852): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: PlatformException(error, PhoneAccount connection service requires BIND_TELECOM_CONNECTION_SERVICE permission., null, java.lang.SecurityException: PhoneAccount connection service requires BIND_TELECOM_CONNECTION_SERVICE permission.

Is the CallKit screen supposed to show on incoming calls?

I'm giving this plugin a spin on iOS and it doesn't appear to be working as I expect. When I click on "Display incoming call now" is the incoming call screen provided by CallKit supposed to show. I'm currently just getting a table below the buttons showing like what is seen in the picture.

IMG_A524671A50EE-1

This is what the logs look like:

flutter: Display incoming call now
flutter: [displayIncomingCall] 37d1c91a-1cd9-44b3-be26-f7559137d01d number: +17606463094
[CallKeep][reportNewIncomingCall] uuidString = 37d1c91a-1cd9-44b3-be26-f7559137d01d
[CallKeep][providerDidReset]
flutter: [CallKeep] INFO: received event "CallKeepProviderReset" {}

Calling displayIncomingCall crashes app on IOS

Hi!

I am using FCM to process background messages and I want to call

_callKeep.displayIncomingCall(callUUID, number,
        handleType: 'number', hasVideo: false);

as was mentioned into example. But this example was for Android, will it work for IOS? Or what setting should be done to make it work?

How to take control to the flutter application after answering the call

Hi,
I am using Fcm background message handler(android) to receive call notification from user-A. when notification is received my background message handler is called and I can able to see the answer or decline view buttons like a normal phone call(I think this is using phone accounts).

my question is how to take control to my application once the user answered the call (can be audio/video call)?

or please do suggest me to get this done. struck here for a long time.

PushKit crashes app on receipt of push

Hi all,

Existing push that works with flutter_voip_kit (has updated payload for callkeep):

curl -v -d '{"aps":{"alert":{"callkeep": {"title":"Incoming call","number":"01224900123"},"badge": {"badge": "0"}}}}' -H "apns-push-type: voip" -H "apns-expiration: 0" -H "apns-priority: 0" -H "apns-topic: blah.voip" --http2 --cert ./cert.pem https://api.sandbox.push.apple.com/3/device/xxx

app instantly dies.

How to display outgoing call UI

Which method should I use to be able to start the call and to display the outgoing call UI ... I need help urgently, please.
Thanks for making this package.

isCallActive: MissingPluginException(No implementation found for method isCallActive on channel FlutterCallKeep.Method

Hi,

I'm timing out an inbound call notification like so

  Future<void> showIncomingCall(
      String ddi, String callerID, String callUUID) async {
    _logger.d('$callerID calling $ddi');
    await _cc.getForPhoneNum(callerID);
    final _callKeep = Get.find<CallController>().callKeep;

    Get.find<FirebaseAnalyticsService>()
        .analytics
        .logEvent(name: 'IncomingCallEvent');

    _callKeep.displayIncomingCall(callUUID, callerID,
        handleType: 'number',
        localizedCallerName:
            _cc.contacts.isEmpty ? ddi : _cc.contacts[0].toString(),
        hasVideo: false);

    Timer(const Duration(seconds: INCOMING_CALL_TIMEOUT_SECS), () async {
      if (await _callKeep.isCallActive(callUUID) == false) {
        _logger.d('Incoming call timed out.');
        Get.find<FirebaseAnalyticsService>()
            .analytics
            .logEvent(name: 'IncomingCallTimeoutEvent');
        _callKeep.rejectCall(callUUID);
      }
    });
  }
E/flutter (26386): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method isCallActive on channel FlutterCallKeep.Method)
E/flutter (26386): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:157:7)
E/flutter (26386): <asynchronous suspension>
E/flutter (26386): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:332:12)
E/flutter (26386): #2      FlutterCallkeep.isCallActive (package:callkeep/src/api.dart:157:8)
E/flutter (26386): #3      NotificationsController.showIncomingCall.<anonymous closure> (package:SureVoIPTalk/src/controller/notifications.dart:69:27)
E/flutter (26386): #4      _rootRun (dart:async/zone.dart:1182:47)
E/flutter (26386): #5      _CustomZone.run (dart:async/zone.dart:1093:19)
E/flutter (26386): #6      _CustomZone.runGuarded (dart:async/zone.dart:997:7)
E/flutter (26386): #7      _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
E/flutter (26386): #8      _rootRun (dart:async/zone.dart:1190:13)
E/flutter (26386): #9      _CustomZone.run (dart:async/zone.dart:1093:19)
E/flutter (26386): #10     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1021:23)
E/flutter (26386): #11     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
E/flutter (26386): #12     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:397:19)
E/flutter (26386): #13     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:428:5)
E/flutter (26386): #14     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

Remove PushKit code from iOS

I don't think it is a good idea to handle pushkit notifications with this plugin.

  • This plugin would be more flexible if a user can call displayIncomingCall from any voip notification structure they seem fit.
  • People will probably constantly need to fork the plugin to work with their applications
  • The popular react native callkeep package also recommends using a seperate push kit package
    What are your thoughts on this?

IOS How to show incoming call only app is in background?

Hi, I m trying to implement an softphone app works with janus gateway an webrtc. everything works fine. to keep app receive calls from janus I have to leave session alive all the time and when a call received my backend will send voip notification.

the problem is backend cant know the app is alive or not and it should send notification everytime call received. my concern is when my app is running I only show incoming call screen and if app is background I want to show callkit screen.
I tried to add lifecycle of flutter WidgetsBindingObserver to control events but it didnt work properly.
I use example app of this package for testing.
any idea will be appriciated.

thanks.

Resived The Call,but when answer the call, app opens to home screen, not to video call screen

W/FlutterJNI( 9878): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: FlutterCallKeep.Event. Response ID: 0

run:

I/flutter ( 9878): backgroundMessage: message => {data: {caller_id: +8618612345678, roomId: M1Eo7b66xdKZ7cd3JjHf, type: VIDEO_CALL, uuid: xxxxx-xxxxx-xxxxx-xxxxx, has_video: true, caller_id_type: number, caller_name: hello}} I/flutter ( 9878): backgroundMessage: displayIncomingCall (+8618612345678) D/RNCK:VoiceConnectionService( 9878): setAvailable: false D/RNCK:VoiceConnectionService( 9878): setAvailable: true D/FLT:CallKeepModule( 9878): displayIncomingCall number: +8618612345678, callerName: hello E/RNCK:VoiceConnectionService( 9878): Constructor D/RNCK:VoiceConnectionService( 9878): setAvailable: false D/RNCK:VoiceConnectionService( 9878): setAvailable: true I/TelecomFramework( 9878): VoiceConnectionService: notifyCreateConnectionComplete TC@16_1: (...->CSW.hCCC)->CS.crCoC->H.CS.crCoC(ctm/cast)@E-E-E-BEY I/TelecomFramework( 9878): VoiceConnectionService: onAudioStateChanged TC@16_1 [AudioState isMuted: false, route: SPEAKER, supportedRouteMask: SPEAKER, activeBluetoothDevice: [null], supportedBluetoothDevices: []]: (...->CSW.hCCC->ICFG.sF->ICFG.sF->ICFG.sF->CILH.sL->CILH.oQC->BCF.gBS->BCF.gBS->ICFG.sF->ICFG.sF->ICFG.sF->ICFG.sF->ICFG.sF->ICFG.sF->ICFG.sF->CARSM.pM_UPDATE_SYSTEM_AUDIO_ROUTE)->CS.cASC->H.CS.cASC(ctm/cast/cast)@E-E-E-BEY I/TelecomFramework( 9878): VoiceConnectionService: onAudioStateChanged TC@16_1 [AudioState isMuted: false, route: SPEAKER, supportedRouteMask: SPEAKER, activeBluetoothDevice: [null], supportedBluetoothDevices: []]: (...->CSW.hCCC->ICFG.sF->ICFG.sF->ICFG.sF->CILH.sL->CILH.oQC->BCF.gBS->BCF.gBS->ICFG.sF->ICFG.sF->ICFG.sF->ICFG.sF->ICFG.sF->ICFG.sF->ICFG.sF->CAMSM.pM_2002->CARSM.pM_SWITCH_FOCUS)->CS.cASC->H.CS.cASC(ctm/cast/cast)@E-E-E-BEY I/TelecomFramework( 9878): VoiceConnectionService: answer TC@16_1: (ICA.aC->CSFM.rF)->CS.an->H.CS.an(cad/cast)@E-BFk D/RNCK:VoiceConnection( 9878): onAnswer called D/RNCK:VoiceConnection( 9878): onAnswer executed W/FlutterJNI( 9878): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: FlutterCallKeep.Event. Response ID: 0 I/chatty ( 9878): uid=10154(com.packageName.me) identical 2 lines W/FlutterJNI( 9878): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: FlutterCallKeep.Event. Response ID: 0 I/flutter ( 9878): [CallKeep] INFO: received event "CallKeepPerformAnswerCallAction" {callUUID: xxxxx-xxxxx-xxxxx-xxxxx} I/flutter ( 9878): THIS IS ROOM ID TxkvHUnr806U7MGXx3XR I/flutter ( 9878): backgroundMessage: CallKeepPerformAnswerCallAction xxxxx-xxxxx-xxxxx-xxxxx I/flutter ( 9878): [CallKeep] INFO: received event "CallKeepDidActivateAudioSession" {} D/FLT:CallKeepModule( 9878): backToForeground, app isOpened ?true I/flutter ( 9878): [CallKeep] INFO: received event "CallKeepPerformAnswerCallAction" {callUUID: xxxxx-xxxxx-xxxxx-xxxxx} D/FLT:CallKeepModule( 9878): endCall called I/flutter ( 9878): THIS IS ROOM ID M1Eo7b66xdKZ7cd3JjHf I/flutter ( 9878): backgroundMessage: CallKeepPerformAnswerCallAction xxxxx-xxxxx-xxxxx-xxxxx D/RNCK:VoiceConnection( 9878): onDisconnect executed D/RNCK:VoiceConnectionService( 9878): deinitConnection:xxxxx-xxxxx-xxxxx-xxxxx D/FLT:CallKeepModule( 9878): endCall executed D/FLT:CallKeepModule( 9878): backToForeground, app isOpened ?true D/FLT:CallKeepModule( 9878): endCall called W/FlutterJNI( 9878): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: FlutterCallKeep.Event. Response ID: 0 I/flutter ( 9878): [CallKeep] INFO: received event "CallKeepPerformEndCallAction" {callUUID: xxxxx-xxxxx-xxxxx-xxxxx} I/flutter ( 9878): backgroundMessage: CallKeepPerformEndCallAction xxxxx-xxxxx-xxxxx-xxxxx W/FlutterJNI( 9878): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: FlutterCallKeep.Event. Response ID: 0 I/flutter ( 9878): [CallKeep] INFO: received event "CallKeepDidActivateAudioSession" {} I/flutter ( 9878): [CallKeep] INFO: received event "CallKeepPerformEndCallAction" {callUUID: xxxxx-xxxxx-xxxxx-xxxxx} I/flutter ( 9878): backgroundMessage: CallKeepPerformEndCallAction xxxxx-xxxxx-xxxxx-xxxxx D/EGL_emulation( 9878): eglCreateContext: 0xe7d87da0: maj 2 min 0 rcv 2 D/EGL_emulation( 9878): eglCreateContext: 0xe7da0a00: maj 2 min 0 rcv 2 D/HostConnection( 9878): HostConnection::get() New Host Connection established 0xe7d8ace0, tid 10767 D/HostConnection( 9878): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_2 D/EGL_emulation( 9878): eglMakeCurrent: 0xe7da0a00: ver 2 0 (tinfo 0xab24a290) (first time) D/HostConnection( 9878): HostConnection::get() New Host Connection established 0xe7d8ee10, tid 10766 D/HostConnection( 9878): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_2 D/EGL_emulation( 9878): eglMakeCurrent: 0xe7d87da0: ver 2 0 (tinfo 0xab27aaf0) (first time) D/EGL_emulation( 9878): eglCreateContext: 0xe7da6110: maj 2 min 0 rcv 2 I/Choreographer( 9878): Skipped 36 frames! The application may be doing too much work on its main thread. D/RNCK:VoiceConnectionService( 9878): setAvailable: false D/RNCK:VoiceConnectionService( 9878): setAvailable: true [GETX] Instance "GetMaterialController" has been created [GETX] Instance "GetMaterialController" has been initialized D/RNCK:VoiceConnectionService( 9878): setAvailable: false D/RNCK:VoiceConnectionService( 9878): setAvailable: true D/RNCK:VoiceConnectionService( 9878): setAvailable: false D/RNCK:VoiceConnectionService( 9878): setAvailable: true D/RNCK:VoiceConnectionService( 9878): setAvailable: false D/RNCK:VoiceConnectionService( 9878): setAvailable: true

setAvailable: Caught error: PlatformException(error, Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference

I/flutter (22732): Caught error: PlatformException(error, Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference, null, java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
I/flutter (22732): 	at io.wazo.callkeep.VoiceConnectionService.setAvailable(VoiceConnectionService.java:87)
I/flutter (22732): 	at io.wazo.callkeep.CallKeepModule.setAvailable(CallKeepModule.java:497)
I/flutter (22732): 	at io.wazo.callkeep.CallKeepModule.HandleMethodCall(CallKeepModule.java:188)
I/flutter (22732): 	at com.github.cloudwebrtc.flutter_callkeep.FlutterCallkeepPlugin.onMethodCall(FlutterCallkeepPlugin.java:69)
I/flutter (22732): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
I/flutter (22732): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
I/flutter (22732): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692)
I/flutter (22732): 	at android.os.MessageQueue.nativePollOnce(Native Method)
I/flutter (22732): 	at android.os.MessageQueue.next(MessageQueue
I/flutter (22732): stackTrace: #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:582:7)
I/flutter (22732): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159:18)
I/flutter (22732): <asynchronous suspension>
I/flutter (22732): #2      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:332:12)
I/flutter (22732): #3      FlutterCallkeep.setAvailable (package:callkeep/src/api.dart:203:10)

This should be a bool not a String -

Future<void> setAvailable(String state) async {

Incoming call for the android

Hi,
Can anyone help me for managing the flow of incoming call for android, I am developing the VoIP app and need to display call on kill state also.

the library is displaying the incoming call as a simple native view, I want to display with custom UI like skype, WhatsApp are doing. and once the user receives the call it opens a particular app.

Thank you,

Rename repo to flutter_callkeep

I'm doing this and it's failing due to name:

dependency_overrides:
  # https://dart.dev/tools/pub/dependencies#git-packages
  sip_ua:
    git: [email protected]:cloudwebrtc/dart-sip-ua.git
  flutter_callkeep:
    git: [email protected]:flutter-webrtc/callkeep.git

and pub get fails:

Running "flutter pub get" in SureVoIP-Talk...                   
Error on line 1, column 7: "name" field doesn't match expected name "flutter_callkeep".

  ╷

1 │ name: callkeep

  │       ^^^^^^^^

  ╵
pub get failed (65;   ╵)
Process finished with exit code 65

Integration with sip-ua

Hi @cloudwebrtc

What are the recommended callbacks to set as per the example app if using sip-ua to manage the call?

I've now got displayIncomingCall triggering on a push from FCM in onBackgroundMessage.

Thanks.

'value' cannot be nil'

Hello,
I am getting this crash whenever I push a voip, i've tried the payload exactly as stated in the readme, any suggestions?

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CXHandle initWithType:value:]: parameter 'value' cannot be nil'
terminating with uncaught exception of type NSException

Different behaviours on iOS and Android

Hi,
I'm experimenting with the example code on iOS and Android.

On iOS (v12), when I click the "Accept" button, the OS calling screen closes and example app is displayed.

But on Android 9, when I click the "Accept" button, the calling screen stays intact and I can not switch to my app but for a video call switching to the main app is mandatory.

Is this the expected behaviour?

Missing PluginRegistry

Hi,

I need to run callkeep in onBackgroundMessage with FCM and in order to do that you need to register the plugin in your main class like so:

// https://stackoverflow.com/questions/61827613/firebase-messaging-onbackgroundmessage-not-handling-notification-when-app-is-on
package com.surevoip.talk;

import io.flutter.app.FlutterApplication;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin;
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService;

import com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin;
import com.github.cloudwebrtc.flutter_callkeep.FlutterCallkeepPlugin;

public class Application extends FlutterApplication implements PluginRegistrantCallback {
    @Override
    public void onCreate() {
        super.onCreate();
        FlutterFirebaseMessagingService.setPluginRegistrant(this);
    }

    @Override
    public void registerWith(PluginRegistry registry) {
        FirebaseMessagingPlugin.registerWith(registry.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin"));
        FlutterLocalNotificationsPlugin.registerWith(registry.registrarFor("com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin"));
        FlutterCallkeepPlugin.registerWith(registry.registrarFor("com.github.cloudwebrtc.flutter_callkeep.FlutterCallKeepPlugin"));
    }
}

but because you don't have the following:

https://github.com/MaikuB/flutter_local_notifications/blob/8df0fc4ded9af570efe94fd758a7fe0cc366c700/flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/FlutterLocalNotificationsPlugin.java#L65

I get:

Running Gradle task 'assembleDebug'...
/home/ghenry/AndroidStudioProjects/SureVoIP-Talk/android/app/src/main/java/com/surevoip/talk/Application.java:25: error: cannot find symbol
        FlutterCallkeepPlugin.registerWith(registry.registrarFor("com.github.cloudwebrtc.flutter_callkeep.FlutterCallKeepPlugin"));
                             ^
  symbol:   method registerWith(Registrar)
  location: class FlutterCallkeepPlugin
1 error

Could you kindly add the missing imports etc.?

Thanks.

backToForeground() does not work when app is closed on Android

First of all: This is a very nice library! I am using callkeep to display an incoming call notification when a message is received via firebase_messaging in onBackgroundMessage. When the user answers the incoming call I call backToForeground() and endCall() to just open the app when answering the call. This works pretty good when the app is running and in the background.

But when the app is closed and a message is received it shows the incoming call notification but when you click on answer, it doesn't launch the app.

I think this is a critical feature for such use case since it can't be guaranteed that the app is alive. I don't know how easy it is to extend backToForeground() so it handles this case properly or if this is even possible at all.

I have yet to test the behavior on iOS if it launches the app by default because backToForeground is not implemented for iOS according to the source code of callkeep.

If you know an alternative solution, please let me know.

onReject

Hi all,

D/RNCK:VoiceConnection(21081): onReject executed
D/RNCK:VoiceConnectionService(21081): deinitConnection:b94baea1-864d-4aca-99e4-9940531c32db
I/flutter (21081): [CallKeep] INFO: received event "CallKeepPerformEndCallAction" {callUUID: b94baea1-864d-4aca-99e4-9940531c32db}

How can I hook into onReject as its not CallKeepPerformEndCallAction().

Thanks.

iOS example creates two calls when video button pressed on lock screen

Steps to reproduce:

  • Tap Display incoming call now in 3s
  • Lock the phone
  • Slide to answer
  • Tap video button
  • App opens with two active calls displayed

I'm also confused as to why the video button is even available when the function says video:false

_callKeep.displayIncomingCall(callUUID, number,
        handleType: 'number', hasVideo: false);

iOS build fails on Flutter stable 1.22.3

     ^
    /Users/runner/hostedtoolcache/flutter/1.22.3-stable/x64/.pub-cache/git/callkeep-283403503ee348a9fde02aa5471174f399459686/ios/Classes/CallKeep.m:330:1: error: missing context for method declaration
    -(void) updateDisplay:(NSString *)uuidString displayName:(NSString *)displayName uri:(NSString *)uri
    ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    26 warnings and 20 errors generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Permissions cause this? Missing channel FlutterCallkeep.Method

I've not checked perms as I was just playing, but would that cause this in my background message?:

I/flutter ( 7734): Background Full Message: {data: {callerId: 01224900123}}
I/flutter ( 7734): Background Message: {data: {callerId: 01224900123}}
I/flutter ( 7734): Display incoming call now
E/flutter ( 7734): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: MissingPluginException(No implementation found for method hasPhoneAccount on channel FlutterCallKeep.Method)
E/flutter ( 7734): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159:7)
E/flutter ( 7734): <asynchronous suspension>
E/flutter ( 7734): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:334:12)

Join Callkeep on Slack

We have some members from react-native-callkeep and form a Slack to discuss about the issues that we face while using callkeep:

https://join.slack.com/t/callkeep/shared_invite/zt-nxb6j2yf-VUfINh~Y~hPZz0lq9GIuBQ

Currently we are working on some issues like:

  • Events not fired properly when wake from killed
  • endCall/endAllCalls can not end the call due to callkit provider reinit
  • The calls sometime have no media stream although all other network connection are established seen on wireshark, not sure related to callkeep or not
  • ...

[Question] voip data schema.

Hi guys. you are building amazing plugging. I want to test it but don't know how I can see data schema which needs to send via VoIP to show callkit.

Excellent!

Tested this and didn't realise flutter_callkeep can integrated calls with native Android. Curious why you've wrapped it?

Documentation

Is there any documentation on how to use this plugin or plans on writing some?

For example:

  • Setting up the plugin for each platform
  • code examples
  • handling background calls with fcm / pushkit

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.