Sending messages from Phone to Watch using WCSession doesn't work only on actual devices

Originator:over.out223
Number:rdar://22282639 Date Originated:14-Aug-2015
Status:Open Resolved:
Product:watchOS Product Version:2
Classification:Other bug Reproducible:Always
 
Summary:
When sending message from iPhone app to Watch app using WCSession on actual devices, the `sendMessage:replyHandler:errorHandler:` returns an error "Watch app is not installed", even if the WCSession object returns "true" for `isReachable()` method.

It works fine on simulator, and sending from Watch to iPhone works even on actual devices. It means that watch app is certainly installed and my implements seem not to be wrong.

If it's really "watch app is not installed", the "reachable" property shouldn't returns "true" and shouldn't be able to send from watch to iphone. So I think these results are not correct compared with the specification.

Steps to Reproduce:
1. Unzip the attachment file.
2. Build & Run the attached app into iPhone and Watch.
3. Launch both of apps (Watch and iPhone). On iPhone, the status label will show "Reachable".
4. Tap the red rounded button on iPhone. 

Expected Results:
When tap the red rounded button on iPhone, a message will be send to Watch.

```
        let paired = WCSession.defaultSession().paired
        let installed = WCSession.defaultSession().watchAppInstalled
        let reachable = WCSession.defaultSession().reachable
        print("paired:\(paired), watchAppInstalled:\(installed), reachable:\(reachable)")
```

The print method will result "paired:true, watchAppInstalled:true, reachable:true".


Actual Results:
When tap the red rounded button on iPhone, an error dialog "watch app is not installed" will be shown.

```
        let paired = WCSession.defaultSession().paired
        let installed = WCSession.defaultSession().watchAppInstalled
        let reachable = WCSession.defaultSession().reachable
        print("paired:\(paired), watchAppInstalled:\(installed), reachable:\(reachable)")
```

The print method will result "paired:true, watchAppInstalled:false, reachable:true".


Version:
iOS 9 beta 5, watchOS 2 beta 5, Xcode 7 beta 5.

Notes:


Configuration:
iPhone 6 plus, bluetooth on
Apple Watch sports

Comments

I had exactly the same issue. Adding the WatchConnectivity framework to "Link Binary With Libraries" under Build Phases resolved the issue. Odd because they were imported into the Swift file.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!