Breaking changes in code
iOS
Remove removeAllListeners method
If your plugin has CAP_PLUGIN_METHOD(removeAllListeners, CAPPluginReturnPromise) in the .m file, it can be removed now, the method is now available for all plugins without defining it.
Add SPM support
Capacitor 6 adds experimental SPM support, you can add support for your plugin following Converting existing plugins to SPM
definitions.ts
addListener signature has been changed to only return a Promise, remove the & PluginListenerHandle.
addListener(
eventName: 'resume',
listenerFunc: () => void,
- ): Promise<PluginListenerHandle> & PluginListenerHandle;
+ ): Promise<PluginListenerHandle>;
Updating Capacitor to 6.0 in your plugin
Using @capacitor/plugin-migration-v5-to-v6
From the plugin folder, run npx @capacitor/plugin-migration-v5-to-v6@latest and it will perform all the file changes automatically.
Updating the files manually
Updating package.json
Update @capacitor/cli, @capacitor/core, @capacitor/android and @capacitor/ios to latest version.