apply method
void
apply({
- required String prompt,
- required List<
String> permissions, - required OnPermissionCall permissionCall,
申请权限
(Android权限需要集成eyflutter_uikit插件)
prompt
没有权限时提醒内容
Implementation
void apply({
required String prompt,
required List<String> permissions,
required OnPermissionCall permissionCall,
}) {
if (permissions.isEmptyList) {
permissionCall(true);
return;
}
CloudChannelManager.instance.send<bool>(_permissionApply, arguments: {
"prompt": prompt,
"permissions": permissions,
}).then((granted) {
permissionCall(granted ?? false);
}, onError: (e) {
permissionCall(false);
});
}