Open sohilpandya opened 7 years ago
There are three distinct UI's that need to be looked at:
Watch app can live inside the corresponding iOS app.
As shown in the structure above:
Watch App bundle
Communication between your WatchKit Extension and iOS app is possible through the Watch Connectivity Framework
The WatchKit extension has an extension object - WKExtension and a corresponding delegate object to manage behavior that is central to your app.
When the Watch app is launched, the methods of WKExtensionDelegate protocol are called for each transition phase:
applicationDidFinishLaunching
applicationDidBecomeActive
or applicationWillResignActive
applicationWillEnterForeground
or applicationDidEnterBackground
Reading through the WatchConnectivity Introduction by Natasha the Robot
I found a link to a tutorial which would guide a user through how to use watchConnectivity, here but unfortunately, it's not compatible with WatchOS3 😢
This has lead me into doing some more research and trying to find out how exactly one would go about implementing this in the latest OS.
Issue is with implementing a new mandatory method called session:activationDidCompleteWithState
😢 😢 😢 😢
An update for the day, I've been trying to get this supposedly simple feature where selecting a button on the watch would change the label on the phone. I have been following this tutorial http://kristina.io/watchos-2-tutorial-using-sendmessage-for-instantaneous-data-transfer-watch-connectivity-1/ which would allow us to transfer some data from the watch to the phone.
Simulator problem I've taken a step closer to achieving that goal, but now I am unable to get the watch simulator to recognise the watch app. :( solution Change the active scheme from just app to apple watch app + phone app as seen below
I've still not managed to get the message between the two devices, I'll leave this as is now and look at it with fresh eyes next week. (or perhaps the weekend. 😄 )
Update from Monday morning session 🔍
I hit a wall on Friday, where I was unable to get the connection to work. After some futher research and looking into some code from the tutorial listed above, I've managed to get v0.1 up and running 🎉
If a user selects the button on the watch, they are able to see the text label change on the iPhone.
My next steps are to create a short tutorial on how to do the following.
@sohilpandya amaze! 😍
Apple has built a guide: Developing for Apple Watch
My plan is to go through the documentation and make notes as I read along so that we can all gain a better understanding of how to go about developing for Apple Watch, which will eventually help with getting v0.1 off the ground #15