Open nastaran-mohammadi opened 1 year ago
Hi, when I call FlutterContacts.requestPermission(); for the first time app crash and error text is: java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=0, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {my.redant.leaf/my.redant.leaf.MainActivity}: java.lang.NullPointerException
but after first time, it works fine! tested on both debug and release mode
I fixed this issue by adding Permission Handler package and added this code `
try {
final PermissionStatus permissionStatus =
await Permission.contacts.request();
// isGranted ... Import native
if (permissionStatus.isGranted) {
/// Import Contact Here
}
} catch (e, stack) {
log(
'Error $e',
stackTrace: stack,
);
}
`
Thanks for reporting. I will look soon.
Hi, when I call FlutterContacts.requestPermission(); for the first time app crash and error text is: java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=0, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {my.redant.leaf/my.redant.leaf.MainActivity}: java.lang.NullPointerException
but after first time, it works fine! tested on both debug and release mode