From fc78c7e33a2d030bab677c5f96ebe980ae89c649 Mon Sep 17 00:00:00 2001 From: Tafel <35837839+tafelnl@users.noreply.github.com> Date: Thu, 13 Jun 2024 11:11:58 +0200 Subject: [PATCH] feat!: do not throw an error on unimplemented platforms (#18) --- ios/Plugin/SafeAreaPlugin.swift | 4 ++-- src/web.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ios/Plugin/SafeAreaPlugin.swift b/ios/Plugin/SafeAreaPlugin.swift index c85992d2..db86b77f 100644 --- a/ios/Plugin/SafeAreaPlugin.swift +++ b/ios/Plugin/SafeAreaPlugin.swift @@ -8,10 +8,10 @@ import Capacitor @objc(SafeAreaPlugin) public class SafeAreaPlugin: CAPPlugin { @objc func enable(_ call: CAPPluginCall) { - call.unimplemented("Not implemented on iOS.") + call.resolve() } @objc func disable(_ call: CAPPluginCall) { - call.unimplemented("Not implemented on iOS.") + call.resolve() } } diff --git a/src/web.ts b/src/web.ts index bba1cc97..616dc8b2 100644 --- a/src/web.ts +++ b/src/web.ts @@ -5,11 +5,11 @@ import type { Config, SafeAreaPlugin } from './definitions'; export class SafeAreaWeb extends WebPlugin implements SafeAreaPlugin { // eslint-disable-next-line @typescript-eslint/no-unused-vars async enable(_options: { config: Config }): Promise { - throw this.unimplemented('Not implemented on web.'); + return; } // eslint-disable-next-line @typescript-eslint/no-unused-vars async disable(_options: { config: Config }): Promise { - throw this.unimplemented('Not implemented on web.'); + return; } }