init method

Future<String?> init(
  1. String licenseId
)
inherited

初始化

Implementation

Future<String?> init(String licenseId) async {
  // var s = await Permission.camera.status;
  // if (![PermissionStatus.granted, PermissionStatus.limited].contains(s)) {
  //   s = await Permission.camera.request();
  //   if (![PermissionStatus.granted, PermissionStatus.limited].contains(s)) {
  //     return "errCode: OTHER_ERROR, errMsg: 无相机使用权限";
  //   }
  // }
  // if (Platform.isAndroid) {
  //   s = await Permission.storage.status;
  //   if (![PermissionStatus.granted, PermissionStatus.limited].contains(s)) {
  //     s = await Permission.storage.request();
  //     if (![PermissionStatus.granted, PermissionStatus.limited].contains(s)) {
  //       return "errCode: OTHER_ERROR, errMsg: 无本地存储权限";
  //     }
  //   }
  // }
  final String? err = await _methodChannel.invokeMethod<String>(
      MethodConstants.Init, licenseId);
  return err;
}