Hi all,
I am working on my first watch project and am having a bit of trouble getting my glance to display the required data at the required time.
Basically, I have a string that I need to get from my iPhone app and display in my glance on the watch. The string is constructed during my app delegate's didFinishLaunchingWithOptions. I am calling sendMessageToParentAppWithString in my GlanceController.swift's willActivate and awakeWithContext methods. I have implemented handleWatchKitExtensionRequest in my app delegate but I cannot for the life of me get my glance to be displayed with the IBOutlet label displaying the correct string.
I believe it is a lifecycle thing that I am misunderstanding as the label immediately displays the correct string the instant that I launch the iPhone app so I know that everything is wired up correctly, so to speak. The string from the iPhone app's delegate is being delivered via the sendMessageToParentAppWithString / handleWatchKitExtensionRequest mechanism and displayed in the correct label but it is not happening soon enough.
Whenever I build and run my project on the phone, the iPhone app runs. I then go into the Apple Watch app on the iPhone and flip the Show in Glances switch. At this point the app is running on my iPhone with the string I need having been built in the app delegate, the Watch app is on the watch but has not yet run, and the glance is installed but it has also not yet run. When I acess the glance on the watch, the label in question is still displaying the default string that was set in my storyboard and that remains the case until I switch back to the app on the phone at which time it updates correctly.
I am a little confused as to what is going on and I have looked at every tutorial and doc I can think of but I still seem to be missing something fundamental as other apps seem to have data displayed in their glances when they are first accessed.
Any help would be greatly appreciated.
Thanks!