The host app can use the -sendProviderMessage:returnError:responseHandler: method to actively send a message to the PacketTunnel.How about PacketTunnel actively sends a message to the host app?
Replies
How about PacketTunnel actively sends a message to the host app?
There’s no direct way to do this. There’s two possibilities here:
The host app is running (A).
The host app is not running (B).
For A, you can build this on top of the app message infrastructure. Just have the app send the provider an app message with the semantics “complete this when you want me to check on your state”. The provider can then hold on to the completion handler and call it when it wants to ‘wake up’ the app. When the app gets this completion it can use other app messages to catch up on the provider’s state.
For B, there isn’t any solution that I can think of. You could imagine a scenario where the provider might cause the app to resume (or relaunch) in the background, but there’s nothing like that right now.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"