From b414bb5d045f86f97e89bc04ad2ab9d7536e199f Mon Sep 17 00:00:00 2001 From: boedy Date: Wed, 2 May 2018 16:18:19 +0200 Subject: [PATCH] keep running webserver in background --- src/ios/Webserver.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ios/Webserver.swift b/src/ios/Webserver.swift index 88e7c77..2ba7970 100644 --- a/src/ios/Webserver.swift +++ b/src/ios/Webserver.swift @@ -98,7 +98,11 @@ if portArgument != nil { port = portArgument as! Int } - self.webServer.start(withPort: UInt(port), bonjourName: nil) + do { + try self.webServer.start(options:[GCDWebServerOption_AutomaticallySuspendInBackground : false, GCDWebServerOption_Port: UInt(port)]) + } catch let error { + print(error.localizedDescription) + } let pluginResult = CDVPluginResult(status: CDVCommandStatus_OK) self.commandDelegate!.send(pluginResult, callbackId: command.callbackId) }