getPermissionEnum static method
Future<Permission?>
getPermissionEnum(
- String permissionString
)
Implementation
static Future<Permission?> getPermissionEnum(String permissionString) async {
switch (permissionString) {
case 'camera':
return Permission.camera;
case 'microphone':
return Permission.microphone;
case 'storage':
if (TencentCloudChatPlatformAdapter().isAndroid) {
final androidInfo = await DeviceInfoPlugin().androidInfo;
if (androidInfo.version.sdkInt <= 32) {
return Permission.storage;
} else {
return Permission.manageExternalStorage;
}
}
case 'photos':
if (TencentCloudChatPlatformAdapter().isAndroid) {
final androidInfo = await DeviceInfoPlugin().androidInfo;
if (androidInfo.version.sdkInt <= 32) {
return Permission.storage;
} else {
return Permission.photos;
}
}
return Permission.photos;
default:
return null;
}
}