18 Replies
      Latest reply on Jun 2, 2017 8:49 AM by xlsmearlx
      ddramowicz Level 1 Level 1 (0 points)

        Hi

        Using Watch OS 3 beta 3 here. My watch app which previously worked with Watch OS 2 seems to be having connectivity issues.

         

        When trying to send a message using

         

          [[WCSession defaultSession] sendMessage: ...
        

         

        the error handler returns an error WCErrorDomain code 7014, WCErrorCodeDeliveryFailed.

         

        The message is only attempted to be sent if the session is reachable, which it is at this point. However when I inspect the session object I can see that while reachable is true and the activationState is 2 (WCSessionActivationStateActivated), other properties such as paired and watchAppInstalled are actually false.

        I am guessing these conflicting properties are connected to the problem.

         

        Interestingly, when I inspect the session object when it is initially activated from the iOS app, the paired and watchAppInstalled values are true.

         

        I have tried looking into the Watch console logs but there is literally so much going on there it is hard to pinpoint where the issue might be.

         

        Has anyone else encountered this issue with Watch OS 3? Or can anyone point me towards what I should be looking for in the watch's console logs? Thanks.

        • Re: WCSession fails to sendMessage
          lmDeveloper1 Level 1 Level 1 (20 points)

          I would file a bug report and post the radar number here, so the it can be directed to the necessary devs if its an issue!

          • Re: WCSession fails to sendMessage
            michaelhoward Level 1 Level 1 (0 points)

            I am having a lot of problems with WatchConnectivity in the Watch and iOS simulator.

            I can make successful connections for a few seconds at the start of a session, then the logs are filled with a constant stream of:

            Watch Extension[10772:415005] [WC] __33-[WCXPCManager onqueue_reconnect]_block_invoke error reconnecting to daemon due to NSXPCConnectionInterrupted

            After this starts, even a new session activation doesnt make it stop.

            • Re: WCSession fails to sendMessage
              hishak Level 1 Level 1 (0 points)

              Having same issue using watch03 from beta 3.  When watch can't get location (works 1/20 tries), [WC] __33 starts quickly streaming.  Also happening when sendMessage fails.

              • Re: WCSession fails to sendMessage
                rohirrim Level 1 Level 1 (0 points)

                i just managed to downgrade to beta 2 (can't find it available online, but my time machine thankfully had the archive) and I can confirm that WCSession works as expected without any code changes. So this appears to be a beta 3 regression / bug.

                • Re: WCSession fails to sendMessage
                  hite Level 1 Level 1 (0 points)

                  For Apple Watch console log. xCode  -> Window>Devices  , Select the iPhone with a paired Apple Watch ,  and click triangle button at left bottom of detail view. You will find them.

                  • Re: WCSession fails to sendMessage
                    robotspacer Level 1 Level 1 (10 points)

                    I'm having similar problems here, even with iOS beta 7 and watchOS beta 6. I see most of these posts are from July—is anyone else still having these issues in the latest betas?


                    I'm trying to do something like this:

                     

                    if (session.reachable) {
                      NSLog(@"Watch app is reachable");
                      [session sendMessage:userInfo replyHandler:nil errorHandler:^(NSError * _Nonnull error) {
                      NSLog(@"Error sending message: %@, %@",error,error.userInfo);
                      }];
                    }
                    

                     

                    And get output like this:

                     

                    Watch app is reachable
                    [WC] -[WCSession onqueue_handleMessageCompletionWithError:withMessageID:] BB8C7AAA-E6FE-470D-BF42-1DE48B53C965 due to WCErrorCodeTransferTimedOut->IDSErrorTypeTimedOut->IDSResponseTimedOut
                    [WC] -[WCSession _onqueue_notifyOfMessageError:withErrorHandler:] errorHandler: YES with WCErrorCodeTransferTimedOut->IDSErrorTypeTimedOut->IDSResponseTimedOut
                    Error sending message: Error Domain=WCErrorDomain Code=7017 "Transfer timed out." UserInfo={NSLocalizedDescription=Transfer timed out., NSUnderlyingError=0x170449ea0 {Error Domain=com.apple.identityservices.error Code=23 "Timed out" UserInfo={NSLocalizedDescription=Timed out, NSUnderlyingError=0x171a59b30 {Error Domain=com.apple.ids.idssenderrordomain Code=12 "(null)"}}}}, {
                        NSLocalizedDescription = "Transfer timed out.";
                        NSUnderlyingError = "Error Domain=com.apple.identityservices.error Code=23 \"Timed out\" UserInfo={NSLocalizedDescription=Timed out, NSUnderlyingError=0x171a59b30 {Error Domain=com.apple.ids.idssenderrordomain Code=12 \"(null)\"}}";
                    }
                    

                     

                    Even after these errors, session.reachable continues to be true.

                      • Re: WCSession fails to sendMessage
                        robotspacer Level 1 Level 1 (10 points)

                        Turns out this was mostly my own dumb fault. In my watch app I had only implemented session:didReceiveMessage:, because I was always using a nil replyHandler when I called sendMessage:replyHandler:errorHandler: on the phone. There wasn't any info I needed back, I just wanted to run some code when it finished.

                         

                        I would have figured this out much sooner if I could get watchOS 3 to give me anything other than kernel logs from a device. Once I tried recreating this problem in the simulator I saw immediately there was an error about a missing method in my WCSessionDelegate.

                         

                        One thing worth noting is that the documentation on WCSession's reachable property is no longer correct: "On iOS, the value is YES when a paired and active Apple Watch is in range and the associated Watch app is running in the foreground. In all other cases, the value is NO."

                         

                        From what I can tell reachable will often, if not always, be YES if your app is in the watchOS 3 Dock, or if it has a complication showing on the current watch face.

                      • Re: WCSession fails to sendMessage
                        xlsmearlx Level 1 Level 1 (0 points)

                        Im having the same problen using iOS 10.2, WatchOS 3 and Xcode 8.3.2 (8E2002).

                        But only when using the simulator, if i use a physical device this error does not happen.

                         

                        WatchKit Extension[6128:479936] [WC] __33-[WCXPCManager onqueue_reconnect]_block_invoke error reconnecting to daemon due to NSXPCConnectionInterrupted
                        could not send message: Error Domain=WCErrorDomain Code=7012 "Message reply took too long." UserInfo={NSLocalizedDescription=Message reply took too long., NSLocalizedFailureReason=Reply timeout occured.}