Hybrid iOS web and native app event's communic

2019-09-18 06:59发布

问题:

I am looking for a hybrid app development strategies. I read about some strategies but one of them is commonly used to put webview in a navigation controller. So the navigation would be done via native app but rest of the visible area would relate to html web.

http://venturebeat.com/2011/08/16/linkedin-node/

http://www.nngroup.com/articles/mobile-native-apps/

My question is, is it possible to communicate from javascript to native events. I have reverse of it, as it is implemented in the phonegap but i haven't found javascript functions are calling some native code events.

Please provide some demo links that are implementing apps via hybrid strategy.

回答1:

Yes, it is possible. I believe your question is already answered and links to external resources are provided within the following SO questions:

iOS JavaScript bridge

How to call Objective-C from Javascript?

How to invoke Objective C method from Javascript and send back data to Javascript in iOS?

Invoke method in objective c code from HTML code using UIWebView

Disclaimer: I am not sure if this qualifies as an answer, but it seems my reputation does not allow me to write comments, so here we go.