简体   繁体   中英

How To Interface Android/iOS App With Cordova Hybrid Application

I need some help in order to interface a native Android/iOS app with my Cordova Hybrid Application and send messages from each to other.

  1. Can I use in total freedom cordova.exec command to send messages to the native application?
  2. Must I create a plugin to embed it?
  3. May you suggest me an example that fits with Cordova 5.0 version?
  4. How can I wrap cordova.exec into an Angular service?

Cordova exec is not a function to execute anything on your device.

It's a function to call native code from the javascript but the function you call has to be either from the cordova framework, or from a plugin.

If you want to communicate between apps, you will have to either make your plugin using native code or maybe you can find a plugin already doing it.

For android you can communicate between apps using intents, for ios I have no idea.

You can have a look at the app launcher plugin , it covers the launching an app from an other app part.

For the passing parameters and receiving result part, on android it's easy, you just have to add parameters to the intent.

For IOS, you can read this document .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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