-->

Can we connect 'phonegap api ' application

2020-07-22 19:01发布

问题:

I am doing a project. The first page should be the web page r 'phonegap api' html page.

when a perticular link r button is tapped , it should be taken to the native Application,purely obj C,Pure native App(with view controllers, table views etc).

Can we connect the html page with the pure native code? If yes, Then Plz tell me how?

Thanks in advance,

Bharath gangpalli

回答1:

You could create a PhoneGap plug-in, which is a custom extension to the PhoneGap API. It includes a bit of native code that does some native-specific functionality, as well as a JavaScript interface that then exposes this functionality to you, the PhoneGap developer. By definition, a plug-in is platform-specific!

In your case, you could create a plug-in that then pushes a new View to the top of the app (overlays over the HTML page, for example).

A good place to start would be Jesse's blog post about them; note that these are specifically for iPhone:

http://blogs.nitobi.com/jesse/2010/04/01/iphonegap-plugs/

Here are some examples of existing PhoneGap plugins, how to use them, and links within to the source code to see how they were built:

https://github.com/phonegap/phonegap-plugins

http://blogs.nitobi.com/shazron/2010/07/12/phonegap-iads-plugin/

http://blog.urbanairship.com/blog/2010/06/09/phonegap-push/

http://blog.clearlyinnovative.com/post/1097750723/phonegap-plugin-for-downloading-url



回答2:

i think you can do that by using the phonegap exec function