sodipto / flutter-phone-state-background

MIT License
5 stars 7 forks source link

No implementation found for method hasPermission on channel #5

Closed fayaman99 closed 1 year ago

fayaman99 commented 1 year ago

test() async { try { await audioRecorder.hasPermission(); } catch (e) { print(e); } }

Future phoneStateBackgroundCallbackHandler( PhoneStateBackgroundEvent event, String number, int duration, ) async { switch (event) { case PhoneStateBackgroundEvent.incomingstart: test(); print("telephone sonne appel entrant"); break; case PhoneStateBackgroundEvent.incomingmissed: // break; case PhoneStateBackgroundEvent.incomingreceived: // break; case PhoneStateBackgroundEvent.incomingend: // print("Appel terminé"); break; case PhoneStateBackgroundEvent.outgoingstart: // break; case PhoneStateBackgroundEvent.outgoingend: // break; } }

Future Lencement_appel() async { test(bool); // return true final permission = await PhoneStateBackground.checkPermission(); if (permission != true) return; await PhoneStateBackground.initialize(phoneStateBackgroundCallbackHandler); }

//***** error ** //

I/flutter ( 4489): MissingPluginException(No implementation found for method hasPermission on channel com.llfbandit.record/messages)

sodipto commented 1 year ago

@fayaman99 this issue may b your audio recoder permission issue. Please cross check.

fayaman99 commented 1 year ago

I have already obtained all the authorization on my main.dart, I can make audio recordings before the phone rings, when the phone rings, it returns this error

//*** main.dart **//

Future getAllPermission() async { await PhoneStateBackground.requestPermissions(); Map<Permission, PermissionStatus> statuses = await [ Permission.location, Permission.microphone, Permission.sms, Permission.phone, Permission.contacts, Permission.storage ].request(); // await MesVariableGlobal.telephony.requestPhoneAndSmsPermissions; }

sodipto commented 1 year ago

@fayaman99 Make sure this two permission added your mainfest file and also checked your app permissions.

<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_CALL_LOG" />
fayaman99 commented 1 year ago

I already have this in my AndroidManifest.xml but it doesn't work

sodipto commented 1 year ago

image

Use like this.

sodipto commented 1 year ago

Also clean your project and rebuild and run again.

fayaman99 commented 1 year ago

I tried, but it doesn't work

sodipto commented 1 year ago

Provide your Flutter sdk version and kotlin version.

sodipto commented 1 year ago

image

Please check this. Error occur audio plugin. Check my plugin separate project without audio plugin.

sodipto commented 1 year ago

Also provide your app permission settings screen?

fayaman99 commented 1 year ago

Capture d’écran (20) Capture d’écran (21) Capture d’écran (22)

sodipto commented 1 year ago

https://meet.google.com/ksv-zztn-ibt please join this link if possiable

sodipto commented 1 year ago

Try to Create new project and run.