docs: provide information how to build a partly native plugin
Bachground: There are some things within the SDKs of Android and iOS and also the capabilities of the Webviews which make it necessary to implement a plugin for one platform und use the web version for the other.
e.g. iOS has a great PDFKit SDK and and the same time a bad pdf implementation in the Webview (yes, pdf.js is not very great as well, some edge cases are not working at all and the performance is bad) Android is good enough with the build in viewer.
Propose: Document how to create such plugins. You have to include the web part in the index.ts
const CustomPlugin = registerPlugin< CustomPlugin >('Custom', {
android: () => import('./web').then(m => new m.CustomWeb()),
web: () => import('./web').then(m => new m.CustomWeb()),
});
And in this case remove android from the capacitor property of the package.json
Hey @MasonVX,
Where would you feel this documentation would be appropriate? In my mind, I feel that snippet of information fits best in the Registering the Web Implementation portion of the Capacitor Plugin Tutorial (link).
If you agree, I invite you to contribute by editing this file: https://github.com/ionic-team/capacitor-docs/blob/main/docs/plugins/tutorial/implementing-for-web.md.