Open andw99 opened 1 year ago
I just noted the Kotlin code was the permission check... this is the invoke permission code...
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler { call, result ->
if (call.method == "requestReadPhoneNumbersPermission") {
// Check if the READ_PHONE_NUMBERS permission is already granted
if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_NUMBERS) != PackageManager.PERMISSION_GRANTED) {
// Request the READ_PHONE_NUMBERS permission
ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.READ_PHONE_NUMBERS), REQUEST_READ_PHONE_NUMBERS)
}
result.success(null)
} else {
result.notImplemented()
}
}
}
you can just add this to your android manifest file
<uses-permission android:name="android.permission.READ_PHONE_NUMBERS" />
you can just add this to your android manifest file
<uses-permission android:name="android.permission.READ_PHONE_NUMBERS" />
@rashedswen - It is already in the android manifest, all other permissions requested in Android manifest work as expected, this one does not.
Do you try to setup the callkeep in main or first page of your app I do that and that work will and request permission when the app opens
Yes, the setup and permission checks all occur once the app opens. From my understanding CallKeep should allow use of system managed Android ConnectionService - but from my recent research, on some makes and models this is not possible as their Android Settings do not permit access to this, hence the exception.
I have an issue that I cannot get around...
Note that using an Android 10 phone, everything works and VoiP and Video calls can be made...
But when attempting to use an Android 12 phone it always fails with the following exception.
I am calling setup with the following code... note that I have created an additional method invoke within MainActivity.kt to attempt to force the permission request - this does not come back with an error but it also does not put up a request dialog.
in the MainActivity.kt - I have included the following code to invoke permission request on READ_PHONE_NUMBERS...
As it stands, I am unable to use CallKeep to handle calls on a phone above Android 10.