doneservices / flutter_callkeep Goto Github PK
View Code? Open in Web Editor NEWiOS CallKit and Android ConnectionService bindings for Flutter
iOS CallKit and Android ConnectionService bindings for Flutter
@LinusU
can you please provide example of usage of the displayCustomIncomingCall()
method.
Originally posted by @gopalkrishan123 in #2 (comment)
flutter_callkeep
packageThe app should setup and be able to trigger the call functionality successfully
Flutter throws a MissingPluginException(No implementation found for method setup on channel co.doneservices/callkeep)
exception
setup
function and directly accessed displayIncomingCall
but the same exception is thrown for this method call as wellHoping for a quick response. Thank you
I followed the steps for iOS that mentions in readme. What's wrong with me or do i need to do some extra for that issue. Please help me.
Hey, is there a way that you could add null safety support? My app doesn't want to start due to:
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:
- package:flutter_callkeep
I ran the example, click the button, gave permission and nothing happens.
Hi, you wrote this below a year ago. However, I tried it, and I expected a full screen native activity to appear when a background FCM notification is received but it just shows the normal drop-down notification and you have to tap on a button to see the full screen native activity.
How can a full screen activity be displayed when a background FCM notification is received? Thanks
Your message:
Add the activity to the Android Manifest:
<activity
android:name=".IncomingCallActivity"
android:exported="true"
android:showOnLockScreen="true" />
Build the activity that will be showed when displaying the call. I used Android Studio for this.
public class IncomingCallActivity extends Activity ...
Trigger showing the screen, this can be done from a background isolate (e.g. Firebase handleBackgroundMessage as well!)
await CallKeep.displayCustomIncomingCall(
'com.yourcompany.yourapp', // Change this
'IncomingCallActivity',
icon: 'notification_icon', // Make sure you have this icon in your assets
extra: <String, dynamic>{
// Here you can pass any key value pairs that you can read using getIntent().getStringExtra("key")
in the native activity
},
)
what I will do if my app is in background mode or killed or screen lock I want something like WhatsApp calling features please help someone to make it. I am getting this error when the app is in background
E/MethodChannel#co.doneservices/callkeep( 4983): Failed to handle method call
E/MethodChannel#co.doneservices/callkeep( 4983): kotlin.KotlinNullPointerException
E/MethodChannel#co.doneservices/callkeep( 4983): at co.doneservices.callkeep.CallKeep.hasPhoneAccount(CallKeep.kt:63)
E/MethodChannel#co.doneservices/callkeep( 4983): at co.doneservices.callkeep.CallKeep.displayIncomingCall(CallKeep.kt:182)
E/MethodChannel#co.doneservices/callkeep( 4983): at co.doneservices.callkeep.CallKeep.onMethodCall(CallKeep.kt:72)
E/MethodChannel#co.doneservices/callkeep( 4983): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:231)
E/MethodChannel#co.doneservices/callkeep( 4983): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:93)
E/MethodChannel#co.doneservices/callkeep( 4983): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:642)
E/MethodChannel#co.doneservices/callkeep( 4983): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#co.doneservices/callkeep( 4983): at android.os.MessageQueue.next(MessageQueue.java:329)
E/MethodChannel#co.doneservices/callkeep( 4983): at android.os.Looper.loop(Looper.java:142)
E/MethodChannel#co.doneservices/callkeep( 4983): at android.app.ActivityThread.main(ActivityThread.java:6375)
E/MethodChannel#co.doneservices/callkeep( 4983): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#co.doneservices/callkeep( 4983): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
E/MethodChannel#co.doneservices/callkeep( 4983): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)
E/flutter ( 4983): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, null, null)
E/flutter ( 4983): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
E/flutter ( 4983): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33)
E/flutter ( 4983):
E/flutter ( 4983): #2 CallKeep.displayIncomingCall (package:flutter_callkeep/flutter_callkeep.dart:181:20)
E/flutter ( 4983): #3 _SplashScreenState.displayIncomingCall (package:camiotalk/pages/splash_page.dart:197:20)
E/flutter ( 4983): #4 myBackgroundMessageHandler (package:camiotalk/pages/splash_page.dart:29:26)
E/flutter ( 4983): #5 _fcmSetupBackgroundChannel. (package:firebase_messaging/firebase_messaging.dart:38:30)
E/flutter ( 4983): #6 MethodChannel._handleAsMethodCall (package:flutter/src/services/platform_channel.dart:402:55)
E/flutter ( 4983): #7 MethodChannel.setMethodCallHandler. (package:flutter/src/services/platform_channel.dart:370:54)
E/flutter ( 4983): #8 _DefaultBinaryMessenger.handlePlatformMessage (package:flutter/src/services/binding.dart:200:33)
E/flutter ( 4983): #9 _invoke3. (dart:ui/hooks.dart:303:15)
E/flutter ( 4983): #10 _rootRun (dart:async/zone.dart:1126:13)
E/flutter ( 4983): #11 _CustomZone.run (dart:async/zone.dart:1023:19)
E/flutter ( 4983): #12 _CustomZone.runGuarded (dart:async/zone.dart:925:7)
E/flutter ( 4983): #13 _invoke3 (dart:ui/hooks.dart:302:10)
E/flutter ( 4983): #14 _dispatchPlatformMessage (dart:ui/hooks.dart:162:5)
E/flutter ( 4983):
Sometimes the notifications is showing but the sound is not playing
how can i ensure 100% delivery ?
Hello everyone, am really interested in this package and I see it's very promising. but does it work at the moment with iOS?
My code:
final callKeepBaseConfig = CallKeepBaseConfig(
appName: 'Done',
androidConfig: CallKeepAndroidConfig(
logo: 'ic_launcher',
notificationIcon: 'ic_launcher',
accentColor: '#34C7C2',
),
iosConfig: CallKeepIosConfig(
iconName: 'Icon',
maximumCallGroups: 1,
handleType: CallKitHandleType.generic
),
);
final config = CallKeepIncomingConfig.fromBaseConfig(
config: callKeepBaseConfig,
uuid: call.id!,
contentTitle: call.remote_display_name,
hasVideo: false,
handle: call.direction,
callerName: "HIHI",
extra: {"data1":"ddwwd","data2":'dwqddddd'},
);
await CallKeep.instance.displayIncomingCall(config);
When I run app in real device ios platform, i got a message:
flutter_callkeep/SwiftCallKeepPlugin.swift:152:
Fatal error: Unexpectedly found nil while unwrapping an Optional value
flutter_callkeep/SwiftCallKeepPlugin.swift:152: Fatal error: Unexpectedly found nil while unwrapping an Optional value
_swift_runtime_on_report libswiftCore.dylib
:: 0x19fa7ca40 <+0>: b 0x19fa7ca3c ; _swift_runtime_on_report libswiftCore.dylib
:What should I do?
flutter call keep not working in app terminated state in release mode but in debug mode its working fine. || Android. Please help to check this issue.
Hi @MrAlek @LinusU @yukitaka13-1110 I simply want to fetch the incoming call number and show the customized native UI for incoming calls with a pop notification from my app that show another message but I can't find it in your documentation. Can you help me with how to get the incoming number on both Android and iOS?
Android versions below 12 will function without issue. Other than that, Android 13 does not allow this. any other option for this.
Xcode build done. 29.4s
[VERBOSE-2:ui_dart_state.cc(166)] Unhandled Exception: MissingPluginException(No implementation found for method setup on channel co.doneservices/callkeep)
#0 MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:159
#1 MethodChannel.invokeMethod
package:flutter/…/services/platform_channel.dart:334
#2 CallKeep.setup
package:flutter_callkeep/flutter_callkeep.dart:112
unable to run the app getting the following error.
using flutter_callkeep: ^0.3.0
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
> Android resource linking failed
ERROR:/Users/imsaharukh/Dev/munchies/munchies_rider/build/flutter_callkeep/intermediates/packaged_res/debug/layout/activity_call_incoming.xml:7: AAPT: error: resource color/done_purple (aka com.now.munchies_rider:color/done_purple) not found.
ERROR:/Users/imsaharukh/Dev/munchies/munchies_rider/build/flutter_callkeep/intermediates/packaged_res/debug/layout/activity_call_incoming.xml:24: AAPT: error: resource string/callHeader (aka com.now.munchies_rider:string/callHeader) not found.
ERROR:/Users/imsaharukh/Dev/munchies/munchies_rider/build/flutter_callkeep/intermediates/packaged_res/debug/layout/activity_call_incoming.xml:45: AAPT: error: resource string/answer (aka com.now.munchies_rider:string/answer) not found.
ERROR:/Users/imsaharukh/Dev/munchies/munchies_rider/build/flutter_callkeep/intermediates/packaged_res/debug/layout/activity_call_incoming.xml:60: AAPT: error: resource string/decline (aka com.now.munchies_rider:string/decline) not found.
hi thankyou for the great work. can i make the call by using the same plugin if do so what changes i have to do. kindly help me in this thanks
When I click Answer button from Notification, no event called.
Support me earliest to release application.
the duration parameter is not working. I want to set that the call should gets dismissed after two seconds but it is getting dismissed in just 30 secs
Does this plugin support the newest version of Flutter?
I upgraded my project and now I have 2.0.6.
Since that moment I can't receive call when an app (android version) is not launched or in backgraound.
Hi everyone, I cannot run my project after adding this pub to my pubspec.yaml. It seems like throw an error when call function CallKeep.setup(). Please anyone can give me an answer how can I fix this error :((
there is a problem with the hasPhoneAccount method channel, wherein the app crash when I ask for permissions..
Can someone resolve these issues.
When I click on display incoming call. I get the following error
E/flutter ( 9687): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: PlatformException(E_ACTIVITY_DOES_NOT_EXIST, ConnectionService not available for this version of Android., null, null)
E/flutter ( 9687): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:581:7)
E/flutter ( 9687): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:158:18)
E/flutter ( 9687): <asynchronous suspension>
E/flutter ( 9687): #2 CallKeep._hasPhoneAccountPermission (package:flutter_callkeep/flutter_callkeep.dart:157:12)
E/flutter ( 9687): <asynchronous suspension>
E/flutter ( 9687): #3 CallKeep.askForPermissionsIfNeeded (package:flutter_callkeep/flutter_callkeep.dart:127:30)
E/flutter ( 9687): <asynchronous suspension>
E/flutter ( 9687): #4 MyApp.displayIncomingCall (package:callkeep_example/main.dart:13:5)
E/flutter ( 9687): <asynchronous suspension>
E/flutter ( 9687):
D/GraphicBuffer( 9687): register, handle(0x7f53cbae80) (w:720 h:1184 s:720 f:0x1 u:0x000b00)
Hi there!
If my app is in background mode and I get callkeep notification, can I go back to foreground(like local notification does on user interactions). As I see there is backToForeground for Android. What about IOS? Is displayCustomIncomingCall feature can do it?) If yes - could you please provide an example
This looks like it's the fully managed version?
https://developer.android.com/guide/topics/connectivity/telecom/#integrateCalling
how to implement IncomingCallActivity ?
how can add action
if answer
Navigator.push(context, MaterialPageRoute(builder: (context)=>AnswerPager()));
if decline
Navigator.push(context, MaterialPageRoute(builder: (context)=>DeclinePager()));
if dontanswer
Navigator.push(context, MaterialPageRoute(builder: (context)=>DeclinePager()));
even the application in background
i use
await CallKeep.displayIncomingCall( callUUID, number, number, HandleType.number, true);
When app in lock screen. I used push notification to show callkit in android. After that, I pushed other notification to cancel call.
Expected results
Actual results
Device Information
Screenshots or Video
Thank you for your support.
Hi,
I am facing an issue when running in ios. Android works good but not showing screen.
Please help with this.
I'm using the plugin on android ,
when i call the method displayIncomingCall() it doesn't show any result,
when i use the then callback after displayIncomingCall() it returns value but doesn't show any thing on the screen.
I am getting this error on Android 14 device when I click on incoming call to make it full screen.
E/AndroidRuntime( 2686): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.buddy.dev/co.doneservices.callkeep.IncomingCallActivity}: java.lang.SecurityException: com.buddy.dev: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
E/AndroidRuntime( 2686): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4164)
E/AndroidRuntime( 2686): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4322)
E/AndroidRuntime( 2686): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
E/AndroidRuntime( 2686): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139)
E/AndroidRuntime( 2686): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96)
E/AndroidRuntime( 2686): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2685)
E/AndroidRuntime( 2686): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime( 2686): at android.os.Looper.loopOnce(Looper.java:230)
E/AndroidRuntime( 2686): at android.os.Looper.loop(Looper.java:319)
E/AndroidRuntime( 2686): at android.app.ActivityThread.main(ActivityThread.java:8918)
E/AndroidRuntime( 2686): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 2686): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
E/AndroidRuntime( 2686): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
java.lang.IllegalArgumentException: Drawable resource ID must not be 0
W/System.err(22156): at androidx.core.graphics.drawable.IconCompat.createWithResource(IconCompat.java:254)
W/System.err(22156): at androidx.core.graphics.drawable.IconCompat.createWithResource(IconCompat.java:242)
W/System.err(22156): at co.doneservices.callkeep.CallKeepNotificationManager.showIncomingNotification(CallKeepNotificationManager.kt:132)
W/System.err(22156): at co.doneservices.callkeep.CallKeepBroadcastReceiver.onReceive(CallKeepBroadcastReceiver.kt:109)
W/System.err(22156): at android.app.ActivityThread.handleReceiver(ActivityThread.java:4544)
W/System.err(22156): at android.app.ActivityThread.-$$Nest$mhandleReceiver(Unknown Source:0)
W/System.err(22156): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2273)
W/System.err(22156): at android.os.Handler.dispatchMessage(Handler.java:106)
W/System.err(22156): at android.os.Looper.loopOnce(Looper.java:211)
W/System.err(22156): at android.os.Looper.loop(Looper.java:300)
W/System.err(22156): at android.app.ActivityThread.main(ActivityThread.java:8232)
W/System.err(22156): at java.lang.reflect.Method.invoke(Native Method)
W/System.err(22156): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
W/System.err(22156): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1028)
await CallKeep.displayCustomIncomingCall(packageName, className, icon: null) ;
can help me by give me a full example to displayCustomIncomingCall
Please give us a FULL example on how to handle notifications and native activities. Thanks
Hi, i'm trying to develop a audio call app using agora sdk and i use this package to display incoming call. Displaying incoming call works perfectlly but when the call is displayed the agora audio stream does'nt work if i close the incoming call the agora audio works . How can i use this package with agora?
Can you tell me how to use it?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.