I'm hoping you smart people can help me as most of the data online is out of date. I have an iPhone app that displays financial information. I would like to present this on a watch glance screen.
I can get the app to send the dictionary of the latest information and the glance does update live if both the Glance screen and phone app are open.
I would like to know how to use the Glance screen to ask the phone app for the latest information. The phone app will probably be closed so it would need waking up and then asked for the current information.
I'm using swift 7 and WatchOS 2.2 and IOS 9.3
A lot of information here on Stackoverflow refers to watchOS 1 so no longer works.
I look forward to your solutions.
Look into WCSession as there are different methods for sending different types of data. This implementation is sending a dictionary.
Must setup a
WCSessionon both watch and phone devices. AppDelegate indidFinishLaunchingWithOptions:and I use the ExtensionDelegate in itsinitmethod. Be sure toimport WatchConnectivitywhen usingWCSession. Using the AppDelegate as aWCSessionDelegatebelow.Setup
WCSessionon the watch:Send message, consisting of a dictionary, to the phone in order to receive information in the callback: