简体   繁体   English

混合iOS Web和本机应用程序事件的通信

[英]Hybrid iOS web and native app event's communication

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. 我读了一些策略,但是其中一种策略通常用于将Webview放在导航控制器中。 So the navigation would be done via native app but rest of the visible area would relate to html web. 因此,导航将通过本机应用程序完成,但其余可见区域将与html Web有关。

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

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

My question is, is it possible to communicate from javascript to native events. 我的问题是,是否有可能从javascript传达到本地事件。 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. 我有相反的看法,因为它是在phonegap中实现的,但是我没有发现javascript函数正在调用某些本机代码事件。

Please provide some demo links that are implementing apps via hybrid strategy. 请提供一些通过混合策略实施应用程序的演示链接。

Yes, it is possible. 对的,这是可能的。 I believe your question is already answered and links to external resources are provided within the following SO questions: 我相信您的问题已经得到解答,并且在以下SO问题中提供了到外部资源的链接:

iOS JavaScript bridge iOS JavaScript桥

How to call Objective-C from Javascript? 如何从Javascript调用Objective-C?

How to invoke Objective C method from Javascript and send back data to Javascript in iOS? 如何从Javascript调用Objective C方法并将数据发送回iOS中的Javascript?

Invoke method in objective c code from HTML code using UIWebView 使用UIWebView从HTML代码中调用目标C代码中的方法

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. 免责声明:我不确定这是否可以作为答案,但是似乎我的名声不允许我发表评论,所以我们继续。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM