I'm trying to send data from my iOS app to my Watch App. The sending of the data seems to work but the reception don't.
When the Watch app receipts a data, it gives me this exception:
[WC] -[WCSession handleApplicationContextWithPairingID:]_block_invoke_2 delegate RSense_Watch_App_Extension.WatchSessionManager does not implement session:didReceiveApplicationContext:
The problem is that I do have the above mentioned function implemented.
This is from my Watch App:
extension WatchSessionManager {
// Receiver
func session(_ session: WCSession, didReceiveApplicationContext applicationContext: [String : AnyObject]) {
DispatchQueue.main.async(execute: {
print("Data Received")
})
}
The iOS and Watch App are correctly paired, and the session is okay too.
Can you find what is strugling?
Thanks to @Larme and @pkc456 I found the issue.
I just added public to my function and changer the parameter "AnyObject" to "Any".
Here is the function updated:
public func session(_ session: WCSession, didReceiveApplicationContext applicationContext: [String : Any]) {
DispatchQueue.main.async(execute: {
print("Data Received")
})
}
It works now.