From the course: Apple watchOS App Development: Advanced APIs

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Direct messaging

Direct messaging

From the course: Apple watchOS App Development: Advanced APIs

Start my 1-month free trial

Direct messaging

- [Instructor] With watch connectivity activated, you're ready to send and receive messages from the app. One type of message sent between apps is a direct message. You do this when both the phone and the watch are in the active state. We'll send the pizza an order status from the phone to the active watch app. Okay go ahead and stop the app. And then close the console. Go to the view controller on the phone. We'll use dictionaries for the message. So I'll add a computed property for the message. So head to the top of the code and just under timed count, add var message and we're going to make this a dictionary of string keys and any value and we're going to return status from our status variable and the other key we'll be using is pizza which is our pizza variable, maybe it's the kind of pizza we have. Alright, and then just under that so I don't have to keep typing WC session default over and over again, I'll add one more thing and that's a constant called session and that will be…

Contents