Launch cycle of iOS app when launched by WatchConnectivity message

Assume that my Watch app is running while the iOS app is not. Then, I send a message from the WatchOS app to the iOS app. In this case the iOS app (should) wake up.


  1. Which methods of the iOS app's delegate object are called?
  2. Is there any possibility to find out if the iOS app was launched because it has received a message from the WatchOS app?


Regards,
Hartwig

Replies

It will call one of these:

/* Called on the delegate of the receiver. Will be called on startup if the incoming message caused the receiver to launch. */
- (void)session:(WCSession *)session didReceiveMessage:(NSDictionary<NSString *, id> *)message;
/* Called on the delegate of the receiver when the sender sends a message that expects a reply. Will be called on startup if the incoming message caused the receiver to launch. */
- (void)session:(WCSession *)session didReceiveMessage:(NSDictionary<NSString *, id> *)message replyHandler:(void(^)(NSDictionary<NSString *, id> *replyMessage))replyHandler;
/* Called on the delegate of the receiver. Will be called on startup if the incoming message data caused the receiver to launch. */
- (void)session:(WCSession *)session didReceiveMessageData:(NSData *)messageData;
/* Called on the delegate of the receiver when the sender sends message data that expects a reply. Will be called on startup if the incoming message data caused the receiver to launch. */
- (void)session:(WCSession *)session didReceiveMessageData:(NSData *)messageData replyHandler:(void(^)(NSData *replyMessageData))replyHandler;