I'm working on extension for the Apple Watch and I need to communicate with the containing app.
MMWormwhole seems like a nice approach for this type of communication. The problem is that my messages are not delivered to the containing app when it is running in background, when opened from openParentApplication
.
Is there any way make the MMWormwhole to receive messages while in background mode?
Yes, it is possible. But you have to ensure that the main app on the iPhone is not suspended before it can send its reply. This can be done by starting a background task in handleWatchKitExtensionRequest as specified in the documentation.
Code in the app delegate of the main app on iPhone: