问题
I would like to extend a ionic / Cordova IOS App by a WatchKit App (native written in swift). I am wondering which is the best way for communication between both. I checked the plugin: github.com/leecrossley/cordova-plugin-apple-watch which allows me to make basic communication, after changing to: MMWormholeTransitingTypeSessionMessage transition type on both sides. (Using Xcode9 and watchOS 4.0). Now I am asking myself if this MMWormhole is the best choice, as development stopped 2-3 years ago. Also for me is not clear if communication is possible if App is in background or even not started so far (how to check this or handle such situations?). My first tries showed that both Apps must be running and on iPhone side it's ok to be in background on WatchKit not.
How are you guys handling this?
Also saw the hint to use sockets for IPC, here I am not sure if this is possible with AppleWatch / WatchKit (have seen some answer doubting it...) Thanks for your help :)
来源:https://stackoverflow.com/questions/46529004/how-to-realize-communication-between-cordova-app-and-native-watchkit-extension