You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/08/23 10:49:23 UTC

[GitHub] [cordova-ios] eskygit opened a new issue, #1248: Can't run native method from javascript

eskygit opened a new issue, #1248:
URL: https://github.com/apache/cordova-ios/issues/1248

   Hi, I have one problem. 
   I am using CDVViewController for iOS.
   https://cordova.apache.org/docs/en/11.x/guide/platforms/ios/webview.html
   
   I Can't run native method from javascript in WKWebview  of CDVViewController property.
   I Want to set WKWebViewConfiguration.userContentController to WKWebview of CDVViewController, but I can't it.
   Please let me know if you have any solution.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] breautek closed issue #1248: Can't run native method from javascript

Posted by GitBox <gi...@apache.org>.
breautek closed issue #1248: Can't run native method from javascript
URL: https://github.com/apache/cordova-ios/issues/1248


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] breautek commented on issue #1248: Can't run native method from javascript

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1248:
URL: https://github.com/apache/cordova-ios/issues/1248#issuecomment-1260903013

   In order for JavaScript to call on native methods, a plugin needs to be implemented to provide that API.
   
   On the javascript side, cordova offers an `exec` function, which is generally implemented on the JS side of the plugin, abstracted by a JS function (to hide implementation details of the plugin, such as the internal service name, and actions etc. Cordova will make the exec call to the appropriate `CordovaPlugin` whose `execute` implementation will receive the action along with arguments. The CordovaPlugin can then take this information and map it to it's own native method by action and do whatever native work necessary.
   
   Relevant resources:
   - https://cordova.apache.org/docs/en/11.x/guide/hybrid/plugins/index.html
   - https://cordova.apache.org/docs/en/11.x/guide/platforms/ios/plugin.html
   
   > I Want to set WKWebViewConfiguration.userContentController to WKWebview of CDVViewController
   
   Unfortunately I can't provide specific pointers, I'm not sure how `CordovaPlugin` can gain access to the `CDVViewController`, but a more appropriate place to ask a support question like this is our [Slack](https://join.slack.com/t/cordova/shared_invite/zt-z70vy6tx-7VNulesO0Qz0Od9QV4tc1Q) community.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org