capacitor-udp icon indicating copy to clipboard operation
capacitor-udp copied to clipboard

Capacitor v4.7 Importing WebPlugin

Open Sebastian-Elstadt opened this issue 1 year ago • 2 comments

My project is running Ionic v6.1.9 with Angular v15.2.0 and Capacitor v4.7.0.

In my service I am trying to import the UdpPlugin like: import { UdpPlugin } from 'capacitor-udp';

But this UdpPlugin class is of type UdpPluginWeb. Which does not have the create methods. If I go to definition, it takes me to the web.d.ts file in the capacitor-udp/dist/esm/ folder in node_modules and I see the UdpPlugin class gets export as:

declare const UdpPlugin: UdpPluginWeb;
export { UdpPlugin };

Plugins and PluginRegistery from @capacitor/core is now deprecated so I can't follow the fixes specified in this plugin's readme file. For Capacitor v4 you must import the plugins directly. What can I do to fix this?

Sebastian-Elstadt avatar Mar 07 '23 11:03 Sebastian-Elstadt

Hi, I'm having the same problem, do you have a solution?

gee1k avatar Mar 17 '23 15:03 gee1k

Hi, I'm having the same problem, do you have a solution?

No, I abandoned the plugin and opted for a TCP approach using WebSockets.

Sebastian-Elstadt avatar Mar 18 '23 11:03 Sebastian-Elstadt