diff --git a/ios/Runner/AppDelegate.m b/ios/Runner/AppDelegate.m index 0dadb66d..d6bc9ef5 100644 --- a/ios/Runner/AppDelegate.m +++ b/ios/Runner/AppDelegate.m @@ -45,6 +45,9 @@ static FlutterMethodChannel* gitChannel = 0; NSArray *sshPublicComponents = [NSArray arrayWithObjects:filesDir, @"ssh", @"id_rsa.pub", nil]; NSString *sshPublicKeyString = [NSString pathWithComponents:sshPublicComponents]; + NSArray *sshPrivateComponents = [NSArray arrayWithObjects:filesDir, @"ssh", @"id_rsa", nil]; + NSString *sshPrivateKeyString = [NSString pathWithComponents:sshPrivateComponents]; + if ([@"getBaseDirectory" isEqualToString:method]) { result(filesDir); } @@ -247,6 +250,14 @@ static FlutterMethodChannel* gitChannel = 0; return; } + [privateKey writeToFile:sshPrivateKeyString atomically:YES encoding:NSUTF8StringEncoding error:&error]; + + if (error != nil) { + result([FlutterError errorWithCode:@"FAILED" + message:[error localizedDescription] details:nil]); + return; + } + result(@YES); } else if ([@"dumpAppLogs" isEqualToString:method]) {