I want to know a better way to send (with iPhone) message to Watch (in background). Currently i use:
session.update(applicationContext: package, completion: nil)
for sending messages to Watch and
func didReceivedApplicationContext(applicationContext:[String : Any])
to receive messages in Watch. The problem is that as is said in documentation "The system will transfer content at opportune times" and i can't control those "oportune times".
At this time, i check in iPhone class the state of Watch. If the Watch is on Background, i send data with updateApplicationcontext (which is not verry good), else, if Watch is on foreground, i send data with sendMessage
Code:
if session.isWatchReachable()
{
session.send(message: package, completion: nil)
}
else
{
session.update(applicationContext: package, completion: nil)
}
So is a better way to transfer data in background?