cybex-dev / twilio_voice

Flutter Twilio Voice Plugin
https://twilio-voice-web.web.app/
MIT License
40 stars 84 forks source link

I can't answer a call when app is killed #17

Closed nestorsgarzonc closed 1 year ago

nestorsgarzonc commented 3 years ago

Hi, I'm using the demo app. I make the configurations and work the app when is in first plane and second plane but when I close the app I receive the notification and try to answer nothing happen. The app doesn't start and I can't answer the call

diegogarciar commented 3 years ago

Hi, I have some questions: In which OS are you experiencing the issue? Are you seeing any logs when trying to answer the call?

nestorsgarzonc commented 3 years ago

I'm using Android 10 I can't see the logs because I close the app :(

nestorsgarzonc commented 3 years ago

This is the error:

BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver

Do you have any idea how to solve it?

diegogarciar commented 3 years ago

Whats the device brand?

nestorsgarzonc commented 3 years ago

I'm using a pixel 3a and Xiaomi Mi 8 Lite

diegogarciar commented 3 years ago

So I use know that on Xiaomi 4A you have to allow background tasks.

try using the function TwilioVoice.instance.requestBackgroundPermission() and check if there's a missing permission

nestorsgarzonc commented 3 years ago

Don't work

nestorsgarzonc commented 3 years ago

You can see the error in 1:10 https://drive.google.com/file/d/1f0HAyyPzhKxomjhPqWyLlyfVcoVeXS5Y/view?usp=sharing

federico-amura-kenility commented 3 years ago

You can see the error in 1:10 https://drive.google.com/file/d/1f0HAyyPzhKxomjhPqWyLlyfVcoVeXS5Y/view?usp=sharing

you found any solution to this? same problem here

diegogarciar commented 3 years ago

I'll try to find the bug today, this issue is very tricky as the logs are not generally available.

diegogarciar commented 3 years ago

So good news, it seems that it's working, I have pushed directly to this repo. Please help me testing and let me know if it works before submitting to pub.dev. Thanks!

PD. I think the toggle speaker button is still broken

federico-amura-kenility commented 3 years ago

Great! I Will try it tomorrow morning. 😄. Thanks!

federico-amura-kenility commented 3 years ago

the proyect not compiles becouse a missing ";" xD Line 94 on TwilioVoicePlugin.java

diegogarciar commented 3 years ago

Weird, I committed just after testing, now its fixed!

Please also check if normal phone answer was not affected by these changes

thangtq3ttech commented 3 years ago

@diegogarciar I haved checkout you repo with commit (51d5640d46ca88550f4badbce1cd7f96cb444de5), But it's still not working. Please help me. Many thank

federico-amura-kenility commented 3 years ago

same here. with the last commit, still no working @diegogarciar

diegogarciar commented 3 years ago

Thanks for the input, I'll try to check it during the week, I would also appreciate if you could send me your logs. You can achieve this by debugging with Android Studio the Android app which is in the android folder, close the app (don't terminate via AS), call the device and you will receive the logs

federico-amura-kenility commented 3 years ago

When a call arrive, the IncomingCallNotificationService send a intent, and the TwilioVoicePlugin should receive it and connect the call. But if the app is killed, the TwilioVoicePlugin never is initilitated. I modified your code, and now its working on Android. But now i realized that on iOS doesnt work either when the app is killed. And i dont know ios

diegogarciar commented 3 years ago

Yes for that reason I had to handle the call on the backgroundCall activity. That was the change I made for it to work, but it seems it is not. Can you create a PR with the changes you made?

For iOS is CallKit showing the incoming call? I think if you kill the app, iOS will not receive the notifications for Apple's policy. you should try killing it by running the app on Xcode and then pressing stop

federico-amura-kenility commented 3 years ago

on ios if the app is openend or minimized, it working ok. But if I open the task manager and kill the app, I am not receiving the notification of the call

diegogarciar commented 3 years ago

Don't kill the app. test stoping the app from debugger.

federico-amura-kenility commented 3 years ago

ok, i will test it, but I can't prevent my end users from killing the app

diegogarciar commented 3 years ago

https://developer.apple.com/forums/thread/65817 https://developer.apple.com/forums/thread/60627

Call notifications are also pushed so when killing the app, Apple can decide to not show the notification reference for VOIP https://developer.apple.com/forums/thread/661010

CricIT commented 3 years ago

how do we solve this? any idea. please help out asap

diegogarciar commented 3 years ago

I have worked on it for some time now with no success, any help is greatly appreciated

diegogarciar commented 3 years ago

I just tried again and did noticed that it was answering correctly from fullscreenIntent but not from the notification. Just pushed an update, could you try it out from master?

cybex-dev commented 3 years ago

Tests:

Test Procedure:

  1. Launch app from testing device, and from a different device
  2. (Received Twilio tokens and set tokens)
  3. Perform test call while app is open to ensure functionality
  4. Close app on testing device (ensuring force closed)
  5. Call testing phone from "different device"
  6. Gather logs from logcat

TL;DR Both platforms work as expected.

Android 10

Android 11


Please note: Log output describes a missed/cancelled call where the calling device places a call and then ends the call soon after w/o any interaction on the testing device.

Test Device:

Log output: (starting call)

11-01 05:58:10.315   789   801 E statsd  : Predicate -7037417284711607308 dropping data for dimension key (10)0x2010101->10873[I] (10)0x30000->*job*/com.awesome.app/io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingBackgroundService[S]
11-01 05:58:10.316   789   801 E statsd  : Predicate 5980654721335871649 dropping data for dimension key (10)0x2010101->10873[I] (10)0x30000->*job*/com.awesome.app/io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingBackgroundService[S]
11-01 05:58:10.329   789   801 E statsd  : Predicate -7037417284711607308 dropping data for dimension key (10)0x2010101->10873[I] (10)0x30000->*job*/com.awesome.app/io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingBackgroundService[S]
11-01 05:58:10.329   789   801 E statsd  : Predicate 5980654721335871649 dropping data for dimension key (10)0x2010101->10873[I] (10)0x30000->*job*/com.awesome.app/io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingBackgroundService[S]
11-01 05:58:10.408 23069 23069 D Vibrator: binder call to service pkg=com.awesome.app, effect=Waveform{mTimings=[0, 400, 400, 400, 400, 400, 400, 400], mAmplitudes=[0, 128, 0, 128, 0, 128, 0, 128], mRepeat=0, mMagnitude=-1, mMagnitudeType=TYPE_EXTRA}
11-01 05:58:10.409  1090  4013 V VibratorService: vibrate - package: com.awesome.app, token: android.os.BinderProxy@2248851, usage: 0, effect: Waveform{mTimings=[0, 400, 400, 400, 400, 400, 400, 400], mAmplitudes=[0, 128, 0, 128, 0, 128, 0, 128], mRepeat=0, mMagnitude=-1, mMagnitudeType=TYPE_EXTRA}, mag: 10000, TYPE_EXTRA
11-01 05:58:10.415  1090  4317 W ActivityManager: Foreground service started from background can not have location/camera/microphone access: service com.awesome.app/com.twilio.twilio_voice.IncomingCallNotificationService
11-01 05:58:10.422  1090  1394 D ApplicationPolicy: isStatusBarNotificationAllowedAsUser: packageName = com.awesome.app,userId = 0
11-01 05:58:10.423  1090  1394 D ApplicationPolicy: isStatusBarNotificationAllowedAsUser: packageName = com.awesome.app,userId = 0
11-01 05:58:10.637  4888  4888 I Popcorn_NotificationListener: onNotificationPosted()::sbn.getPackageName() = com.awesome.app
11-01 05:58:10.637  2780  2780 I Launcher.NotificationListener: onNotificationPosted : com.awesome.app number : 0
11-01 05:58:10.638  2780  2851 I Launcher.NotificationListener: notificationIsValidForUI : com.awesome.app missingTitleAndText : false isGroupHeader : false
11-01 05:58:10.639  3189  3250 I RequestManager_FLP: Notification for foreground service is posted, from com.awesome.app
11-01 05:58:10.644  2535  2535 D InterruptionStateProvider: No bubble up: not allowed to bubble: 0|com.awesome.app|-643449395|null|10873
11-01 05:58:10.647  2535  2535 W NotifBindPipeline: Row is not set so pipeline will not run. notif = 0|com.awesome.app|-643449395|null|10873
11-01 05:58:11.104  9889  9889 I AppsEdge.Badge: key=com.awesome.app:0 count=1
11-01 05:58:15.185  9889  9889 I AppsEdge.Badge: key=com.awesome.app:0 count=1

Log output: (call cancelled/ended)

11-01 05:58:35.840 23069 23069 V Vibrator: cancel(): pid: 23069, PackageName: com.awesome.app, token: android.os.Binder@54d8de2
11-01 05:58:35.865  1090  4316 D ApplicationPolicy: isStatusBarNotificationAllowedAsUser: packageName = com.awesome.app,userId = 0
11-01 05:58:35.865  1090  4316 D ApplicationPolicy: isStatusBarNotificationAllowedAsUser: packageName = com.awesome.app,userId = 0
11-01 05:58:35.871  1090  1090 D EdgeLightingManager: hideForNotification : packageName = com.awesome.app
11-01 05:58:35.872  1090  1090 D EdgeLightingPolicyManager:NotificationGroup: remove : sbn : StatusBarNotification(pkg=com.awesome.app user=UserHandle{0} id=-643449395 tag=null key=0|com.awesome.app|-643449395|null|10873: Notification(channel=notification-channel-high-importance shortcut=null contentView=null vibrate=[0,400,400,400,400,400,400,400] sound=null defaults=0x0 flags=0xf2 color=0x00000000 category=call actions=2 vis=PUBLIC semFlags=0x1000 semPriority=0 semMissedCount=0))
11-01 05:58:35.884  2535  2535 D FaceWidgetNotificationManager: removeFaceWidgetMusicNotification() key : 0|com.awesome.app|-643449395|null|10873
11-01 05:58:35.886  3189  3250 I RequestManager_FLP: Notification for foreground service is removed, from com.awesome.app
11-01 05:58:36.103  4888  4888 I Popcorn_NotificationListener: onNotificationPosted()::sbn.getPackageName() = com.awesome.app
11-01 05:58:36.104  2780  2780 I Launcher.NotificationListener: onNotificationPosted : com.awesome.app number : 0
11-01 05:58:36.104  2780  2851 I Launcher.NotificationListener: notificationIsValidForUI : com.awesome.app missingTitleAndText : false isGroupHeader : false
11-01 05:58:36.122  2535  2535 D InterruptionStateProvider: No bubble up: not allowed to bubble: 0|com.awesome.app|100|null|10873
11-01 05:58:36.122  2535  2535 W NotifBindPipeline: Row is not set so pipeline will not run. notif = 0|com.awesome.app|100|null|10873

Test Device:

Log output: (starting call)

11-01 05:51:02.535  5191 10955 V VibratorService: vibrate - package: com.awesome.app, token: android.os.BinderProxy@62ce43, usage: 0, effect: Waveform{mTimings=[0, 400, 400, 400, 400, 400, 400, 400], mAmplitudes=[0, 128, 0, 128, 0, 128, 0, 128], mRepeat=0, mMagnitude=-1, mMagnitudeType=TYPE_EXTRA}, mag: 9999, TYPE_EXTRA
11-01 05:51:02.569  5191  5219 D ApplicationPolicy: isStatusBarNotificationAllowedAsUser: packageName = com.awesome.app,userId = 0
11-01 05:51:02.571  5191  5219 D ApplicationPolicy: isStatusBarNotificationAllowedAsUser: packageName = com.awesome.app,userId = 0
11-01 05:51:02.684  5191  5191 D NotificationService: 0|com.awesome.app|-643877305|null|10314: granting content://settings/system/notification_sound
11-01 05:51:02.691  9378  9496 V NotificationManager_FLP: Notification for foreground service is posted, 0|com.awesome.app|-643877305|null|10314
11-01 05:51:02.693  9441  9441 D Launcher.NotificationListener: onNotificationPosted : com.awesome.app number : 0 listener : null
11-01 05:51:02.693  9441  9441 D Launcher.NotificationListener: shouldBeFilteredOut : com.awesome.app missingTitleAndText : false isGroupHeader : false
11-01 05:51:02.685  5191  5191 D NotificationService: 0|com.awesome.app|-643877305|null|10314: granting content://settings/system/notification_sound

Log output: (call cancelled/ended)

11-01 05:51:17.415 21907 21907 V Vibrator: Called cancel() API - PID: 10314, PackageName: com.awesome.app, token: android.os.Binder@fe0a44
11-01 05:51:17.441  5191 10955 D ApplicationPolicy: isStatusBarNotificationAllowedAsUser: packageName = com.awesome.app,userId = 0
11-01 05:51:17.443  5191 10955 D ApplicationPolicy: isStatusBarNotificationAllowedAsUser: packageName = com.awesome.app,userId = 0
11-01 05:51:17.456  9441  9441 D Launcher.NotificationListener: onNotificationRemoved : StatusBarNotification(pkg=com.awesome.app user=UserHandle{0} id=-643877305 tag=null key=0|com.awesome.app|-643877305|null|10314: Notification(channel=notification-channel-high-importance pri=2 contentView=null vibrate=[0,400,400,400,400,400,400,400] sound=null defaults=0x0 flags=0xf2 color=0x00000000 category=call actions=2 vis=PUBLIC semFlags=0x0 semPriority=0 semMissedCount=0)) listener : null
11-01 05:51:17.462  9378  9496 V NotificationManager_FLP: Notification for foreground service is removed, 0|com.awesome.app|-643877305|null|10314
11-01 05:51:17.554  5191  5191 D NotificationService: 0|com.awesome.app|100|null|10314: granting content://settings/system/notification_sound
11-01 05:51:17.560  9441  9441 D Launcher.NotificationListener: onNotificationPosted : com.awesome.app number : 0 listener : null
11-01 05:51:17.561  9441  9441 D Launcher.NotificationListener: shouldBeFilteredOut : com.awesome.app missingTitleAndText : false isGroupHeader : false
11-01 05:51:17.556  5191  5191 D NotificationService: 0|com.awesome.app|100|null|10314: granting content://settings/system/notification_sound
cybex-dev commented 3 years ago

When a call arrive, the IncomingCallNotificationService send a intent, and the TwilioVoicePlugin should receive it and connect the call. But if the app is killed, the TwilioVoicePlugin never is initilitated. I modified your code, and now its working on Android. But now i realized that on iOS doesnt work either when the app is killed. And i dont know ios

I found in my test above (having been logged into an iOS testing device with valid Twilio token), my iOS kept ringing during my tests while the app was closed.

Device: iPhone 6s (iOS 13.6.1), Environment: debug Twilio (APN): sandbox

I will report back later with iPhone 7 (iOS 14.4.1) in both sandbox & prod environments.

danj565 commented 2 years ago

I am having the same issue. I get the below error when I try to invoke TwilioVoice.instance.call.place when app is in background..

How do you make sure the plugin in registered on these background firebase notifications?

Doctor:

[✓] Flutter (Channel stable, 2.5.3, on macOS 12.0.1 21A559 darwin-arm, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.61.2)
[✓] Connected device (2 available)

Error:

E/MethodChannel#twilio_voice/messages( 3005): Failed to handle method call
E/MethodChannel#twilio_voice/messages( 3005): java.lang.NullPointerException: context must not be null
E/MethodChannel#twilio_voice/messages( 3005):   at com.twilio.voice.Preconditions.checkNotNull(Preconditions.java:821)
E/MethodChannel#twilio_voice/messages( 3005):   at com.twilio.voice.Voice.connect(Voice.java:550)
E/MethodChannel#twilio_voice/messages( 3005):   at com.twilio.twilio_voice.TwilioVoicePlugin.onMethodCall(TwilioVoicePlugin.java:440)
E/MethodChannel#twilio_voice/messages( 3005):   at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/MethodChannel#twilio_voice/messages( 3005):   at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:84)
E/MethodChannel#twilio_voice/messages( 3005):   at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:865)
E/MethodChannel#twilio_voice/messages( 3005):   at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#twilio_voice/messages( 3005):   at android.os.MessageQueue.next(MessageQueue.java:336)
E/MethodChannel#twilio_voice/messages( 3005):   at android.os.Looper.loop(Looper.java:197)
E/MethodChannel#twilio_voice/messages( 3005):   at android.app.ActivityThread.main(ActivityThread.java:8107)
E/MethodChannel#twilio_voice/messages( 3005):   at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#twilio_voice/messages( 3005):   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
E/MethodChannel#twilio_voice/messages( 3005):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
E/flutter ( 3005): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: PlatformException(error, context must not be null, null, java.lang.NullPointerException: context must not be null
E/flutter ( 3005):  at com.twilio.voice.Preconditions.checkNotNull(Preconditions.java:821)
E/flutter ( 3005):  at com.twilio.voice.Voice.connect(Voice.java:550)
E/flutter ( 3005):  at com.twilio.twilio_voice.TwilioVoicePlugin.onMethodCall(TwilioVoicePlugin.java:440)
E/flutter ( 3005):  at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/flutter ( 3005):  at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:84)
E/flutter ( 3005):  at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:865)
E/flutter ( 3005):  at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter ( 3005):  at android.os.MessageQueue.next(MessageQueue.java:336)
E/flutter ( 3005):  at android.os.Looper.loop(Looper.java:197)
E/flutter ( 3005):  at android.app.ActivityThread.main(ActivityThread.java:8107)
E/flutter ( 3005):  at java.lang.reflect.Method.invoke(Native Method)
E/flutter ( 3005):  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
E/flutter ( 3005):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
E/flutter ( 3005): )
E/flutter ( 3005): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7)
E/flutter ( 3005): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18)
E/flutter ( 3005): <asynchronous suspension>
danj565 commented 2 years ago

@diegogarciar Also, FYI, I am using Flutter CallKeep and simply calling TwilioVoice.instance.call.place on "CallKeepPerformAnswerCallAction".

It works perfectly in iOS, but having the above error in android.. Is this advisable to use these two libraries?

Thank you!!

cybex-dev commented 2 years ago

@danj565 I speak under correction but this will happen under an isolate. You will need to make sure you register the Twilio client and check tokens i.e. expired or not and if so refresh tokens - this should successfully register with FCM/APNS.

victor-padovam commented 2 years ago

i have the same problem #54

danj565 commented 2 years ago

@danj565 I speak under correction but this will happen under an isolate. You will need to make sure you register the Twilio client and check tokens i.e. expired or not and if so refresh tokens - this should successfully register with FCM/APNS.

@cybex-dev Thanks so much for your reply and understood!! I have tried countless things to to register "context" under isolate including attempting to manually modify the library with no success. Sounds like no matter what, I cannot "instance.call.place" a call under isolate. Correct?

What I am trying to do (And managed to do in my old React Native app and in iOS using this library with slight modifications) is use a separate CallKeep library to manage my inbound ringing and then invoke this library when I want to simply connect the caller to a conference. I want to get away from having to go through Twilio for signaling therefore my attempt to manage callKit on my own.. Let me know if there is any way to get around this limitation.

Have a great day!

cybex-dev commented 2 years ago

@danj565 I speak under correction but this will happen under an isolate. You will need to make sure you register the Twilio client and check tokens i.e. expired or not and if so refresh tokens - this should successfully register with FCM/APNS.

@cybex-dev Thanks so much for your reply and understood!! I have tried countless things to to register "context" under isolate including attempting to manually modify the library with no success. Sounds like no matter what, I cannot "instance.call.place" a call under isolate. Correct?

What I am trying to do (And managed to do in my old React Native app and in iOS using this library with slight modifications) is use a separate CallKeep library to manage my inbound ringing and then invoke this library when I want to simply connect the caller to a conference. I want to get away from having to go through Twilio for signaling therefore my attempt to manage callKit on my own.. Let me know if there is any way to get around this limitation.

Have a great day!

are you trying to do this from a background message handler? This I believe requires a native impl to call startActivity() (or iOS equivalent). My implementation uses the get_it package where I use routes and a NavigationKey (the navigation key stores a context). Glad you found a solution though.

danj565 commented 2 years ago

@danj565 I speak under correction but this will happen under an isolate. You will need to make sure you register the Twilio client and check tokens i.e. expired or not and if so refresh tokens - this should successfully register with FCM/APNS.

@cybex-dev Thanks so much for your reply and understood!! I have tried countless things to to register "context" under isolate including attempting to manually modify the library with no success. Sounds like no matter what, I cannot "instance.call.place" a call under isolate. Correct? What I am trying to do (And managed to do in my old React Native app and in iOS using this library with slight modifications) is use a separate CallKeep library to manage my inbound ringing and then invoke this library when I want to simply connect the caller to a conference. I want to get away from having to go through Twilio for signaling therefore my attempt to manage callKit on my own.. Let me know if there is any way to get around this limitation. Have a great day!

are you trying to do this from a background message handler? This I believe requires a native impl to call startActivity() (or iOS equivalent). My implementation uses the get_it package where I use routes and a NavigationKey (the navigation key stores a context). Glad you found a solution though.

No solution as of yet for Android.. Right now I am relying on the old React Native app to offer inbound calling for Android.. Ideally, I fix this in my Flutter version so I don't have two implementations :).. To answer your question, yes, I am attempting to place the call in the onBackgroundMessage handler (isolate) in the firebase library.

https://firebase.flutter.dev/docs/messaging/usage

I am going to try the library you suggested (get_it) and report back.. Are you saying that might provide a context that this library (twilio_voice) could use while in isolate / background?

Thanks again.. You guys are awesome!

victor-padovam commented 2 years ago

If someone managed to solve the problem and raise a PR for the repo of the package. I would appreciate it.

victor-padovam commented 2 years ago

@cybex-dev you any solucionar for this problem?

cybex-dev commented 2 years ago

@cybex-dev you any solucionar for this problem?

honestly - I don't think I fully understand the issue. I've been able to answer calls consistently from my app in production (testflight) w/o any issues, when closed, when open and when in background.

victor-padovam commented 2 years ago

did you disable notifications when the app is completely closed, dead? I was thinking about doing this. what solution did you do to reverse this?

cybex-dev commented 2 years ago

did you disable notifications when the app is completely closed, dead? I was thinking about doing this. what solution did you do to reverse this?

No - all notifications allowed & mic permissions enabled. This is checked on opening and then again prior to accepting/making a call, in addition to the caller checking if their token is valid and not about to expire (else it generates a new token first then continues with call)

victor-padovam commented 2 years ago

@cybex-dev you cannot raise a PR with your solution. to accept call when app is completely closed, dead? I'm stuck on it too.

there are two problems with the package. does not show the name of who is calling me. and not being able to "accept" a call when the app is completely closed. ☹

cybex-dev commented 2 years ago

@cybex-dev you cannot raise a PR with your solution. to accept call when app is completely closed, dead? I'm stuck on it too.

there are two problems with the package. does not show the name of who is calling me. and not being able to "accept" a call when the app is completely closed. ☹

I will make a PR with my caller ID solution a bit later today, regarding the second problem you will need to add some logging to your preferred platform iOS or Android and see what triggers where and what doesn't trigger.

victor-padovam commented 2 years ago

Great guy. come up and let us know, thank you very much indeed.

regarding the second problem as the app is closed, the notification appears and when accepted, the screen in Background does not open. as the app is dead I can't handle it.

cybex-dev commented 2 years ago

Great guy. come up and let us know, thank you very much indeed.

regarding the second problem as the app is closed, the notification appears and when accepted, the screen in Background does not open. as the app is dead I can't handle it.

Have you seen this? https://github.com/diegogarciar/twilio_voice/blob/master/example/lib/main.dart#L250

Also, take a look at e.g. Android code that runs after an incoming call notification is shown:

Alternatively, take a look at the AnswerCallActivity's acceptCall function: (https://github.com/diegogarciar/twilio_voice/blob/master/android/src/main/java/com/twilio/twilio_voice/AnswerJavaActivity.java#L188)

victor-padovam commented 2 years ago

Ótimo rapaz. venha e diga-nos, muito obrigado. em relação ao segundo problema quando o aplicativo é fechado, a notificação aparece e quando aceita, a tela em Segundo Plano não abre. como o aplicativo está morto, não consigo lidar com isso.

você viu isso? https://github.com/diegogarciar/twilio_voice/blob/master/example/lib/main.dart#L250

Além disso, observe, por exemplo, o código Android que é executado após a exibição de uma notificação de chamada recebida:

Como alternativa, dê uma olhada na função acceptCall de AnswerCallActivity: ( https://github.com/diegogarciar/twilio_voice/blob/master/android/src/main/java/com/twilio/twilio_voice/AnswerJavaActivity.java#L188 )

@cybex-dev I just ran a test for the above quote in: https://github.com/diegogarciar/twilio_voice/blob/master/example/lib/main.dart#L250

It calls this function pushToCallScreen() when my app is in the background so far so good!!! Now when my app is closed, dead, retired even in the background. it can't call the flutter function because the app is dead so it can't get to it.

'Decline' works, but 'accept' doesn't open the app along with a call screen. exemplo: https://drive.google.com/file/d/1IQ9_UO_u7V7AmgwOPA5E2x8SF6Zgs5aV/view?usp=sharing

cybex-dev commented 2 years ago

there must be a reason why accept doesn't open, what do the logs say, etc.

victor-padovam commented 2 years ago

@cybex-dev I'm running the project in VsCode with flutter I passed flutter logs

when I get the call in the case the notification it shows me this:

[D/FlutterFcmService( 5909): From: 362646411367
I/flutter ( 5909): background message 
D/FlutterFcmService( 5909): Received onMessageReceived()
D/FlutterFcmService( 5909): From: 362646411367]

It's just a confirmation that I received it. more when I click 'Accept' and it doesn't open the call screen. at least here on flutter logs he doesn't show me that return.

I don't know much in native. if i open the project in android studio the correct is to open

victor-padovam commented 2 years ago

@cybex-dev you can forward me your e-mail to ask a question.

victor-padovam commented 2 years ago

problem was solved at least for me what i did I downloaded the /root folder again and it worked.

Aritesh commented 2 years ago

hi i getting same issue i tried all this things but I not able to receive a call when app is close please guide me how to fix this issue