Add config export on ios

This commit is contained in:
problematicconsumer
2024-01-15 01:39:05 +03:30
parent 204c47605c
commit 1d5b50c8f5

View File

@@ -154,6 +154,21 @@ public class MethodHandler: NSObject, FlutterPlugin {
return return
} }
result(true) result(true)
case "generate_config":
guard
let args = call.arguments as? [String:Any?],
let path = args["path"] as? String
else {
result(FlutterError(code: "INVALID_ARGS", message: nil, details: nil))
return
}
var error: NSError?
let config = MobileBuildConfig(path, VPNConfig.shared.configOptions, &error)
if let error {
result(FlutterError(code: "BUILD_CONFIG", message: error.localizedDescription, details: nil))
return
}
result(config)
default: default:
result(FlutterMethodNotImplemented) result(FlutterMethodNotImplemented)
} }