From 0b73dba4a7f71ff3c79e4da8be04fa16fa1bbb76 Mon Sep 17 00:00:00 2001 From: Bryan Castro MCM <165092738+bcastro-mcm@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:12:35 -0500 Subject: [PATCH] feat: Implement exitApp in iOS --- app/ios/Sources/AppPlugin/AppPlugin.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/ios/Sources/AppPlugin/AppPlugin.swift b/app/ios/Sources/AppPlugin/AppPlugin.swift index 0f6086507..1c0a97143 100644 --- a/app/ios/Sources/AppPlugin/AppPlugin.swift +++ b/app/ios/Sources/AppPlugin/AppPlugin.swift @@ -75,7 +75,12 @@ public class AppPlugin: CAPPlugin, CAPBridgedPlugin { } @objc func exitApp(_ call: CAPPluginCall) { - call.unimplemented() + DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) { + UIApplication.shared.perform(#selector(NSXPCConnection.suspend)) + DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) { + exit(0) + } + } } @objc func getInfo(_ call: CAPPluginCall) {