hiennguyen92 / flutter_callkit_incoming

Flutter Callkit Incoming
https://pub.dev/packages/flutter_callkit_incoming
MIT License
154 stars 246 forks source link

duplicate notification with your example #77

Closed EmelianShkira closed 4 months ago

EmelianShkira commented 2 years ago

when I run your example https://github.com/hiennguyen92/flutter_callkit_incoming/tree/master/example without change anything it will give me another notification after decline the previous one

https://user-images.githubusercontent.com/46813666/161380921-bf39585e-2b7f-4e98-bee7-d0002c4694bd.mp4

hiennguyen92 commented 2 years ago

@EmelianShkira I am not able to reproduce this issue. can you tell me android version you are using or phone brand....?

EmelianShkira commented 2 years ago

@hiennguyen92 I'm using xiaomi POCO X3 PRO (M2102J20SG) with MIUI 12.5.9 with android 11 update: in release mode the problem is solved but another issue come..notification come without ringing until I enable incoming notification ringtone in my device settings for this app ..just in release mode this problem happend not in debugging

hiennguyen92 commented 2 years ago

@EmelianShkira It seems this issue is caused by MIUI Xiaomi

https://github.com/MaikuB/flutter_local_notifications/issues/852#issuecomment-827995444

hiennguyen92 commented 2 years ago

This problem may be related to Xiaomi MIUI launcher

EmelianShkira commented 2 years ago

no also I install the app on other devices like Samsung j7 also same problem no ringtone until i enable it manually from settings the value of key 'ringtonePath' : 'system_ringtone_default'

hiennguyen92 commented 2 years ago

I can't reproduce the issue. Please be sure not to be in silent mode. What Samsung settings do you use?

EmelianShkira commented 2 years ago

i mean actual settings of app from my device settings.. no I'm not in silent mode

hiennguyen92 commented 2 years ago

I tested on samsung device, however, can't reproduce it. Can you recored the whole setting process?

EmelianShkira commented 2 years ago

@hiennguyen92 the problem of sound was solved by set false to (shrinkResources & minifyEnabled & useProguard) but the duplicate notification still exist with all kind of devices !!

Edman-99 commented 2 years ago

Change { "type" : 1}

hiennguyen92 commented 2 years ago

Ok. I will check it

suhail600 commented 2 years ago

I tested on samsung device, however, can't reproduce it. Can you recored the whole setting process?

I also faced same issue , but not with popup for accepting call , its when restarting the device its automatically routes to the page where I placed the code inside the callkit , and even i clode that page it comes when restarts

zionnite commented 2 years ago

@hiennguyen92, I thought version 1.0.2would fix this, but there is still a duplicate of the incoming call notification

suhail600 commented 2 years ago

Ok. I will check it

@hiennguyen92 checkAndNavigationCallingPage(); is running many times 3 to 4 times and thus resulting in screen duplication, pushing same screen 3 to four times please help with this

waqadArshad commented 1 year ago

Ok. I will check it

@hiennguyen92 checkAndNavigationCallingPage(); is running many times 3 to 4 times and thus resulting in screen duplication, pushing same screen 3 to four times please help with this

@suhail600 this duplication is not there because of that unless you are calling your showCallKitIncoming in that checkAndNavigationCallingPage(). It happens only when you pick the call up in the first 2 seconds. But if u give I t let's say 4-5 seconds before accepting the call, it would not cause that duplication.

waqadArshad commented 1 year ago

Ok. I will check it

@hiennguyen92 As far as I have tested, the duplication happens only when you pick the call up in the first 2 seconds. But if u give it let's say 4-5 seconds before accepting the call, it would not cause that duplication. Can you please suggest a workaround? Thanks

HasanAlyazidi commented 1 year ago

It occurs on Samsung Galaxy S22 Ultra too but only when the app is running in the foreground.

A temporary fix is to check if the active call is duplicated, ignore the subsequent calls of checkAndShowCallingPage()

waqadArshad commented 1 year ago

I don't think that would work because it happens only in android and I don't think it is because of the code I wrote

suhail600 commented 1 year ago

its been one year ,may be its due to an error in the firebase messaging package, I am not sure @hiennguyen92 can check this https://github.com/firebase/flutterfire/issues/10768

hiennguyen92 commented 4 months ago

I think this issue may come from FCM (I checked their log). to ensure the notification is only shown once. I think you should check before calling showcallkit.something similar to: onBackground(message){ if(message.messageId){ //show here } } Same with onMessage