Alezhka / flutter_incoming_call

Flutter incoming call
https://pub.dev/packages/flutter_incoming_call
GNU General Public License v3.0
22 stars 24 forks source link

Unable to see the notifications. Only hears the sound. #16

Open arslankaleem7229 opened 2 years ago

arslankaleem7229 commented 2 years ago

This is what I am getting

E/MediaPlayerNative( 9511): trying to set audio attributes called in state 8
D/CompatibilityChangeReporter( 9511): Compat change id reported: 160794467; UID 10152; state: ENABLED
E/MethodChannel#flutter_incoming_call( 9511): Failed to handle method call
E/MethodChannel#flutter_incoming_call( 9511): java.lang.IllegalArgumentException: com.example.call: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
E/MethodChannel#flutter_incoming_call( 9511): Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
E/MethodChannel#flutter_incoming_call( 9511):   at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
E/MethodChannel#flutter_incoming_call( 9511):   at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:645)
E/MethodChannel#flutter_incoming_call( 9511):   at android.app.PendingIntent.getBroadcast(PendingIntent.java:632)
E/MethodChannel#flutter_incoming_call( 9511):   at com.github.alezhka.flutter_incoming_call.CallNotification.showCallNotification(CallNotification.kt:43)
E/MethodChannel#flutter_incoming_call( 9511):   at com.github.alezhka.flutter_incoming_call.FlutterIncomingCallPlugin.onMethodCall(FlutterIncomingCallPlugin.kt:73)
E/MethodChannel#flutter_incoming_call( 9511):   at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
E/MethodChannel#flutter_incoming_call( 9511):   at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#flutter_incoming_call( 9511):   at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/MethodChannel#flutter_incoming_call( 9511):   at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#flutter_incoming_call( 9511):   at android.os.Handler.handleCallback(Handler.java:938)
E/MethodChannel#flutter_incoming_call( 9511):   at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#flutter_incoming_call( 9511):   at android.os.Looper.loopOnce(Looper.java:201)
E/MethodChannel#flutter_incoming_call( 9511):   at android.os.Looper.loop(Looper.java:288)
E/MethodChannel#flutter_incoming_call( 9511):   at android.app.ActivityThread.main(ActivityThread.java:7842)
E/MethodChannel#flutter_incoming_call( 9511):   at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#flutter_incoming_call( 9511):   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/MethodChannel#flutter_incoming_call( 9511):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
E/flutter ( 9511): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, com.example.call: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
E/flutter ( 9511): Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles., null, java.lang.IllegalArgumentException: com.example.call: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
E/flutter ( 9511): Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
E/flutter ( 9511):  at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
E/flutter ( 9511):  at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:645)
E/flutter ( 9511):  at android.app.PendingIntent.getBroadcast(PendingIntent.java:632)
E/flutter ( 9511):  at com.github.alezhka.flutter_incoming_call.CallNotification.showCallNotification(CallNotification.kt:43)
E/flutter ( 9511):  at com.github.alezhka.flutter_incoming_call.FlutterIncomingCallPlugin.onMethodCall(FlutterIncomingCallPlugin.kt:73)
E/flutter ( 9511):  at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
E/flutter ( 9511):  at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/flutter ( 9511):  at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/flutter ( 9511):  at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/flutter ( 9511):  at android.os.Handler.handleCallback(Handler.java:938)
E/flutter ( 9511):  at android.os.Handler.dispatchMessage(Handler.java:99)
E/flutter ( 9511):  at android.os.Looper.loopOnce(Looper.java:201)
E/flutter ( 9511):  at android.os.Looper.loop(Looper.java:288)
E/flutter ( 9511):  at android.app.ActivityThread.main(ActivityThread.java:7842)
E/flutter ( 9511):  at java.lang.reflect.Method.invoke(Native Method)
E/flutter ( 9511):  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/flutter ( 9511):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
E/flutter ( 9511): )
E/flutter ( 9511): #0      StandardMethodCodec.decodeEnvelope
E/flutter ( 9511): #1      MethodChannel._invokeMethod
E/flutter ( 9511): <asynchronous suspension>
E/flutter ( 9511): #2      FlutterIncomingCall.displayIncomingCall
E/flutter ( 9511): <asynchronous suspension>
E/flutter ( 9511):
D/EGL_emulation( 9511): app_time_stats: avg=35606.44ms min=35606.44ms max=35606.44ms count=1
Lost connection to device.
Exited
AlexBacich commented 1 year ago

Same here. Might be worth switching to https://pub.dev/packages/flutter_callkit_incoming. This one is not updated for 1.5 years already. And target version 31 is not supported.

AlexBacich commented 1 year ago

Fixed this in this PR: https://github.com/Alezhka/flutter_incoming_call/pull/9