Open imariman opened 3 years ago
You need to develop a call UI in the app.
I couldn't find any example or information about that. Let say I developed a UI, how can I change this UI with the default Call Screen? I would appreciate if you give a little bit detail or share some links about that issue. Thank you very much.
I am also looking for a solution to this. If you found the solution please don't hesitate to share.
I would also like to see an example.
I am looking for solution also
I have solved this problem by using another package called "connectycube_flutter_call_kit". Link: https://pub.dev/packages/connectycube_flutter_call_kit
By default, this package uses its custom UI which includes the Connectycube logo, but you can change it by yourself. In Windows, once I download the package, the directory of package becomes "C:\Users\
Good luck.
Thank you, but for Android we just can call backToForeground and see custom incoming call, the main difficulty is with ios(
@Imariman, how did you register their plugin in the application file? ConnectycubeFlutterCallKitPlugin.registerWith fails for me. Thanks.
@jenniestrongbow I wrote my own method.
.Application.kt
override fun registerWith(registry: PluginRegistry) {
com.connectycube.flutter.connectycube_flutter_call_kit.ConnectycubeFlutterCallKitPlugin().registerWith(registry.registrarFor("com.connectycube.flutter.connectycube_flutter_call_kit.ConnectycubeFlutterCallKitPlugin")); }
ConnectycubeFlutterCallKitPlugin.kt
fun registerWith(registrar: PluginRegistry.Registrar) { mainActivity = registrar.activity() registrar.addNewIntentListener(this) onAttachedToEngine(registrar.context(), registrar.messenger()) }
@imariman thanks! Could you please publish a very simple flutter example explaining on how to use their plugin? I'm really struggling.
All I want to be able to do is show a full screen incoming call screen inside the FCM's onBackgroundMessage method.
How can I handle the accept/reject buttons in flutter?
Thanks
@imariman, thanks to you, I managed to show the full screen notification.
Can you pls show me how to handle the accept / reject buttons?
Thanks
@jenniestrongbow Happy to hear you have managed to show the screen you want. Handling accept/reject buttons is the easiest part. ConnectycubeFlutterCallKit.instance.init() method has two parameters; "onCallAccepted" and "onCallRejected". Just write your logic there and it works.
@imariman thanks again. Last question. The init method has no impact as the showCallNotification method cannot be used with an instance. How do I use init and showCallNotification using the same instance? Thanks
@jenniestrongbow Methods like showCallNotification, setOnLockScreenVisibility are static methods, you can't call a static method like ConnectycubeFlutterCallKit.instance.showCallNotification . The static method belongs to a class instead of class instances.
Just init the ConnectycubeFlutterCallKit with your logic, and set the fields of showCallNotification. Example code below.
`
ConnectycubeFlutterCallKit.instance.init(
onCallAccepted: (
String sessionId,
int callType,
int callerId,
String callerName,
Set
await ConnectycubeFlutterCallKit.showCallNotification(
sessionId: sessionId,
callType: type == "video" ? 1 : 0,
callerName: number,
callerId: 0,
opponentsIds: s,
);
`
Hope it helps.
@imariman you are a gentleman, thanks a million for your help!!!
@imariman When app is in terminated how did u connect to socket.... can u help me that?.. socket connection works in background in flutter?... how did u figured that
@sarathvs41 I used Firebase Messaging to handle background messages when app is terminated. Once you trigger "onBackgroundMessage", you can show notification or add data to database. Once user clicks to notification, app starts and you can make your socket connetion to your server. There are some other alternatives like "background_fetch" but since firebase messaging solved my problem I didn't take a deep look at it.
@imariman Thanks for your reply
@imariman I am also following your suggestions related showing call notification from onBackgroundMessage . I am able to show incoming call notification and full screen (when phone is in locked state). Can you please suggest how you managed to handle accept/reject buttons events when app is in background? I tried to apply listeners onCallAccepted and onCallRejected, but they are not working when they are set from onBackgroundMessage (or at any part in code) and app is in background.
@imariman I am also following your suggestions related showing call notification from onBackgroundMessage . I am able to show incoming call notification and full screen (when phone is in locked state). Can you please suggest how you managed to handle accept/reject buttons events when app is in background? I tried to apply listeners onCallAccepted and onCallRejected, but they are not working when they are set from onBackgroundMessage (or at any part in code) and app is in background.
I am not sure, but It seems issue at my side is because of old flutter
and firebase_messaging
version.
@imariman thanks for mentioning the package that solves Many developers problems,
I have used the plugin which you have suggested and it works when app in background mode (onCallAccepted is called - and I do my logic based on the accept/reject). but when the app is in killed state lam getting notification to accept/reject but onCallAccepted is not called , the same happens when app is in locked mode.
can you please help on this to get it done.
Thanks in advance.
@aravindhkumar23 can you share a simple example app using this plugin? I could not find a way to show the call screen.
How To handle onCallAccepted in App Kill State? I use Firebase background Notification triggered but not answer. With my Function
for this we can use /packages/connectycube_flutter_call_kit
can you provide me the source code for that file or project
@imariman What is the sessionId in CallEvent method, can you share the example of this plugin
Thanks in advance.
@imariman I am developing an app in flutter. Actually, I need to display my custom incoming and outgoing call screens instead of the default call screens. Kindly help me to solve this. Thanks in advance
@imariman @jenniestrongbow can you please share the source code
Thank you a million @imariman you are a gentleman, you have no idea how much value you gave us
@BhaskarTrigsy the source is part of the project https://pub.dev/packages/connectycube_flutter_call_kit. the example project is a pretty basic architecture where you include the package in your yaml file and the project does the rest. To test if the integration into your project is working, send an FCM message with your device's token.
@imariman hello there. I'm using the connectytube_flutter_call_kit package and twillio to make a video call. A firebase push notice will be raised, and a connectytube call notification will be made. But I want the call screen to be the same as when the device is locked. '. Is this feature covered by the package?.And another issue when i am tapped anywhere in the notification is disappear i want to expand that into call screen like the call screen when device is locked
I want to show a custom Incoming Call Screen instead system's default Incoming Call Screen. Is it possible with this package? I would appreciate if anyone can help me about how to do that? Thanks.
Example Picture (Left Picture): http://www.filmytales.com/wp-content/uploads/2020/04/1587834231telegram-group-video-call-screen_1587979613-701x526.jpg