feat: dont show errors if plugin isn't supported on the current platform #2959
Replies: 4 comments 1 reply
-
Added the needs discussion tag as should be discussed BTW, there is a |
Beta Was this translation helpful? Give feedback.
-
instead of error just throw console.warn that this plugin doesnt support for web |
Beta Was this translation helpful? Give feedback.
-
I'd suggest implementing some kind of no-op implementation in the platform where the plugin isn't supported. The warning could be added there. Then you can probably pitch any platform-detection logic. |
Beta Was this translation helpful? Give feedback.
-
I have to agree with the others. Most of the time there is no harm in making the call a no-op on the web, so that should be the default. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
It seems like capacitor should be able to handle exceptions like the following and prevent us from having to wrap calls like this in platform checks.
More generally, if a native capacitor plugin isn't supported on [some platform]:
Beta Was this translation helpful? Give feedback.
All reactions