Sunday, April 5, 2015

WatchKit FAQ Items


This is a summary of few main points got in to me about the watch kit after going through the article in reference. 

How many Apple watches can be paired with iPhone? 
one Apple watch at a time. 

Can one pair Apple watch with iPad? 
No. 

Can iPhone app wake up watch extension and watch app?
No. Only watch kit extension can request System to launch the iPhone app which happens in the background and not the other way around. 

Can third party app make phone calls from a watch app? 
No. There is no third party api that lets one to initiate a phone call directly from watch kit extension. Since the companion app cannot be brought to foreground either, all the calls to the openURL are ignored silently. 

Can a watch app access hardware sensors such as heartbeat sensors and other sensors on the watch from watch app? 
No, there is no API to access hardware sensors on the watch from Watch app at this time. 

What are the difference between Short-look, long-look, static and dynamic notifications? 
Short-Look : a short look notification is provided by the system. Similar to a notification that appears on the iPhone at the banner, user don’t have any control over this short look notification. A short look notification displays App icon, app name and the title string from the notifications payload. When the notification arrives, system displays the notification and if the user raise the wrist, it get converted to a long-look notification after a slight pause. 

Long-Look. A long look notification can be either static or dynamic. 

Static: A static notification includes a single label that is populated automatically using the notifications payload. One can create a static notification scene in the watch app’s storyboard, but can’t really customise it beyond changing the color of the label and title. 

Dynamic: Dynamic notification require one to subclass WKUserInterfaceController. It is instantiated from the storyboard, and one can provide own custom interface. Note that there is no guarantee that a dynamic notification interface will be displayed. For e.g. if the watch battery is low, system may decide to show a static notification interface instead of dynamic one in the interest to preserve the battery. 

To note, one cannot create and add subviews dynamically in the app watch app, it is possible to hide and show the ui elements those are already in the story board. 

Is there UIActivityIndicator or UIAlertViewController? 
No, but one can display WKInterfaceCotnroller modally. One can work around the activity indicator by providing a series of images that is necessary for creating animation. 

Can one use Coregraphics to generate image dynamically and then use them in a watch app? Can they be cached on the watch? 
YEs, but the composition of those images should be happening in the iPhone watch kit extension. Once we have rendered the core graphics drawing context into an image, one can cache that on to the watch app by calling addCachedImage() from WKInterfaceDevice 

Can one create Custom Views in the Apple Watch? Can the public interface be customised ? 
No. Once cannot customize any views. Watch kit only support certain native interface elements. 

How does the Apple watch communicate with the iPhone? 
The Apple watch leverage both bluetooth LE or Wifi technologies to communicate with its paired phone. The exact nature of communication and its implementation is opaque to both users and developers. 

Can one use Apple watch while in Airplane mode? 
Yes. If bluetooth and WiFi can be turned on while in airplane mode, Apple watch can communicate with the phone. 

What happens when watch app cannot communicate with the paired iPhone ? 
The app won’t run and if running already, it will be suspended. 

In the Watchkit extension, didDeactivate() method will be called to indicate the loss of connectivity. Also, a red icon will be displayed on the status bar on the watch to indicate the loss of connectivity. 

How can a watch app communicate with its companion iPhone app? 
There are various techniques for this, one being watch app writes the data in a shared container and notifies the iPhone app. 
Another technique is to pass the data into the iPhone app as a dictionary, but this can be only initiated by the watch app. There is a single API for the watch kit extension; call the parent Application openParentApplication(userInfo:reply) of WKInterfaceController, as shown in the following snippet. 

to receive this communication, the companion app must implement application(:handleWatchKitExtensionRequest:reply)
If the companion app is in the background, then it will be waken up to process this. Companion app can pass the data back as well allowing the watch app to be able to process the response. 

  
Referencnes:

No comments:

Post a Comment