SessionReachabilityDidChange not called on watch

I want the chat app to respond to the parent app on the phone that was killed. When the clock application is launched and the phone application is killed, I do not receive a callback from sessionReachabilityDidChangeor sessionWatchStateDidChange. Based on the documentation for the apple:

This method is called to inform the current process that its comparability is achieved by colleagues.

So it seems like I should get a callback. I assigned a WCSession delegate to my class on the watch. The session on the watch accepts callbacks for the application context. Why am I not getting reachability callback?

Code below ..

+ (SomeClass *)sharedInstance {
    static dispatch_once_t pred;
    static SomeClass *shared = nil;
    dispatch_once(&pred, ^{
        shared = [[SomeClass alloc] init];
        [Model sharedInstance].delegate = shared;
    });
    return shared;
}

#pragma mark - setup

- (void)initializeSession {
    if ([WCSession isSupported]) {
        WCSession *session = [WCSession defaultSession];
        session.delegate = self;
        [session activateSession];
        [self sync];
    }
}

-(BOOL) hasValidWCSession {
    return ([WCSession isSupported] && [WCSession defaultSession].isReachable);
}


#pragma mark - WCSessionDelegate

- (void)session:(nonnull WCSession *)session didReceiveApplicationContext:(nonnull NSDictionary<NSString *, id> *)applicationContext {

    NSLog(@"application context received on watch: %@", applicationContext);
    [[Model sharedInstance] process:applicationContext];
}


- (void)sessionWatchStateDidChange:(WCSession *)session {
    NSLog(@"wcession state changed on watch");
}

- (void)sessionReachabilityDidChange:(WCSession *)session {
    NSLog(@"wcsession reachability changed on watch");
}
+4
1

iPhone , reachable Apple Watch. iPhone , WCSession watch iPhone .

, , sessionReachabilityDidChange: watch, iOS . , iPhone- WCSession, watch ( , push- .. iOS).

, iPhone, , " Apple Watch , Watch " (documentation).

, sessionWatchStateDidChange: , , watchAppInstalled, complicationEnabled watchDirectoryURL WCSession.

+4

All Articles