ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
https://capacitorjs.com
MIT License
11.24k stars 955 forks source link

[Bug]: Local plugins within the native iOS project are showing as "not implemented." after upgrading to Capacitor 6 #7443

Closed jchri853 closed 1 week ago

jchri853 commented 2 weeks ago

Capacitor Version

💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 6.0.0 @capacitor/core: 6.0.0 @capacitor/android: 6.0.0 @capacitor/ios: 6.0.0

Installed Dependencies:

@capacitor/android: not installed @capacitor/cli: 6.0.0 @capacitor/core: 6.0.0 @capacitor/ios: 6.0.0

[success] iOS looking great! 👌

Other API Details

node - v18.14.2
npm - 9.5.0

Platforms Affected

Current Behavior

I integrate over 10 in-house capacitor plugins into my iOS native app. These plugins are managed within a designated folder named 'Capacitor Plugins' (.m / .swift files) and seamlessly bridged with my Ionic/Angular hybrid app

In my Ionic app, I utilize these plugins to retrieve data from the native iOS app. However, after upgrading from Capacitor 5 to 6, all these plugins are now showing as 'unimplemented.'

Expected Behavior

Plugins should work the same as they did using capacitor 5.7.5

Project Reproduction

https://github.com/jchri853/cap6-ios-bug

Additional Information

Simulator Screenshot - iPad mini (6th generation) - 2024-05-01 at 19 53 12

App should display the following prompt under capacitor 5 and 6 using the apprater plugin. Instead the demo project reports

⚡️ WebView loaded ⚡️ To Native -> App addListener 54677256 ⚡️ To Native -> Keyboard getResizeMode 54677257 ⚡️ TO JS {"mode":"native"} ⚡️ [error] - ERROR {"code":"UNIMPLEMENTED"}

piotrblasiak commented 2 weeks ago

Got this as well

jcesarmobile commented 1 week ago

closing as duplicate of https://github.com/ionic-team/capacitor-docs/issues/275

Capacitor 6 removes automatic plugin registration on iOS, for NPM plugins we can get the classes and register them programmatically, but for custom code you have to call register yourself, see https://capacitorjs.com/docs/ios/custom-code#register-the-plugin