I'm using Ionic Capacitor (javascript application ios/android native wrappers), and I have a situation where I want to get a small piece of data from the javascript layer and pass to ./ios/App/AppDelegate.swift.
Is there any way to achieve this without the use of a plugin? For example, can AppDelegate.swift "listen" for javascript events in a manner similar to how a Capacitor plugin would?
Thus, in my application, I would have a form field (e.g. for email), and then on button click I pass the string to AppDelegate.swift, which then does something with it.
CodePudding user response:
Plugin is likely your only shot.
Not sure which features of that SDK your using, but you could try using the Cordova plugin they provide. Capacitor supports using some Cordova plugins.
CodePudding user response:
Yes you can do it. It's documented here That not the favourite way, though.
Edit:
this is from native to JS in the doc, sorry about it.
