exec method
Run command.
The contents of katana.yaml
and the arguments of the command are passed to context
.
コマンドを実行します。
context
にkatana.yaml
の内容やコマンドの引数が渡されます。
Implementation
@override
Future<void> exec(ExecContext context) async {
final app = context.yaml.getAsMap("app");
if (app.isEmpty) {
error("The item [app] is missing. Please add an item.");
return;
}
final att = app.getAsMap("app_tracking_transparency");
if (att.isEmpty) {
error(
"The item [app]->[app_tracking_transparency] is missing. Please add an item.");
return;
}
final permission = att.getAsMap("permission");
await addFlutterImport(
[
"permission_handler",
],
);
label("Addition of permission messages.");
await XCodePermissionType.userTrackingUsage.setMessageToXCode(
permission
.map((key, value) => MapEntry(key, value.toString()))
.where((key, value) => value.isNotEmpty),
);
await PodfilePermissionType.userTrackingUsage.enablePermissionToPodfile();
}