From 53ec2c772adbc38d3f2bc7152cfccb67d310681c Mon Sep 17 00:00:00 2001 From: Ian Keith Date: Tue, 24 Nov 2020 10:54:53 -0500 Subject: [PATCH 1/2] Adding stub implementations of permissions calls to the plugin base class. --- ios/Capacitor/Capacitor/CAPPlugin.h | 5 +++++ ios/Capacitor/Capacitor/CAPPlugin.m | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/ios/Capacitor/Capacitor/CAPPlugin.h b/ios/Capacitor/Capacitor/CAPPlugin.h index e66eace880..94fe863034 100644 --- a/ios/Capacitor/Capacitor/CAPPlugin.h +++ b/ios/Capacitor/Capacitor/CAPPlugin.h @@ -24,6 +24,11 @@ - (void)addListener:(CAPPluginCall* _Nonnull)call; - (void)removeListener:(CAPPluginCall* _Nonnull)call; - (void)removeAllListeners:(CAPPluginCall* _Nonnull)call; +/** + * Default implementation of the capacitor 3.0 permission pattern + */ +- (void)checkPermissions:(CAPPluginCall* _Nonnull)call; +- (void)requestPermissions:(CAPPluginCall* _Nonnull)call; /** * Give the plugins a chance to take control when a URL is about to be loaded in the WebView. * Returning true causes the WebView to abort loading the URL. diff --git a/ios/Capacitor/Capacitor/CAPPlugin.m b/ios/Capacitor/Capacitor/CAPPlugin.m index 10b2bfa143..a65a14fb11 100644 --- a/ios/Capacitor/Capacitor/CAPPlugin.m +++ b/ios/Capacitor/Capacitor/CAPPlugin.m @@ -140,6 +140,14 @@ - (BOOL)hasListeners:(NSString *)eventName { return [listeners count] > 0; } +- (void)checkPermissions:(CAPPluginCall *)call { + [call resolve]; +} + +- (void)requestPermissions:(CAPPluginCall *)call { + [call resolve]; +} + /** * Configure popover sourceRect, sourceView and permittedArrowDirections to show it centered */ From 3af70ceb13813b70707b9d7fedc90e5d0ee0bb70 Mon Sep 17 00:00:00 2001 From: Ian Keith Date: Tue, 24 Nov 2020 11:56:17 -0500 Subject: [PATCH 2/2] Match formatting to rest of the file. --- ios/Capacitor/Capacitor/CAPPlugin.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/Capacitor/Capacitor/CAPPlugin.m b/ios/Capacitor/Capacitor/CAPPlugin.m index a65a14fb11..d103026128 100644 --- a/ios/Capacitor/Capacitor/CAPPlugin.m +++ b/ios/Capacitor/Capacitor/CAPPlugin.m @@ -141,11 +141,11 @@ - (BOOL)hasListeners:(NSString *)eventName { } - (void)checkPermissions:(CAPPluginCall *)call { - [call resolve]; + [call resolve]; } - (void)requestPermissions:(CAPPluginCall *)call { - [call resolve]; + [call resolve]; } /**