We can customise the long-look, but not the short-look.
We have to register the Notification types and their actions using classes:
Foreground and background actions are processed differently (foreground open Watch app, background open iPhone app).
Only has icon, the title of notifications, and the app name.
Remote-Notification: title key of alert dictionary in payload.
Long Look (link)
When the wrist remains raised – or user taps short look -> long look will appear. (will be auto-dismissed when user lower wrist). The wrist-remains-raised-case can be turn-off if Notification Privacy if On.
If we take too long to display the Custom, Watch will display the Static one instead.
Use: completionHandler(WKUserNotificationInterfaceTypeCustom); // to display the Custom Notification at the end of didReceive
(?) – How to test Long-Look? There is a Scheme Glance, duplicate that, in Run – change Executable to Notification one. The data can be changed in PushNotificationPayload.apns file.
(?) – Customise the Long-Look: create Action with UIUserNotificationAction. Action’s activation mode can be UIUserNotificationActivationMode.Background, Foreground. After that, create ntfs = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:actions];
then call [[UIApplication sharedApplication] registerUserNotificationSettings:ntfs]; to register. Based on these actions in this registration, Watch will add the corresponding buttons to the Long-Look.
Actions handlers for Long-Look (Interactive Notifications)
Interactive Notifications are the new thing in iOS 8. It allows users to choose action for each notification – for example, when you are notified of someone who invited you, you can choose Accept or Ignore.
On the iPhone side, appDelegate would use
application:handleActionWithIdentifier:forLocalNotification:completionHandler: method to handle the actions.
(?) – How action is handled? The Payload will define the possible action, these actions are processed in the above functions, according to their identifiers.
Glances are the way to quickly have a peek without opening the app. It should offer important, simple but relevant information. Glances should be thoroughly designed:
- Contextually relevant: can use time and location data to provide details that matters – for example, showing the main currency that the trader are interested.
- Content quick and easy to read: use SYSTEM font, less words, use image.
- Left-aligned: Apple-recommended.
- No INTERACTIVE controls !!! (buttons, sliders…)
- Avoid Tables & Maps
- BE UPDATED!
Glance are not running in the same process as the Watch app – so they are separate entities !
http://www.brianjcoleman.com/tutorial-building-an-apple-watch-glance/ show how we can create Glance.
(?) Can the Watch app reuse the data loaded from Glances network call or we have to call again when the App launches?
YES. ” To customize the launch behavior of your app from a glance, do the following:
In the glance interface controller:
updateUserActivity:userInfo:webpageURL:method at some point and use the userInfoparameter to convey information about the state of the glance to your app. At launch time, your app can use that contextual data to display a different interface controller.
In your app’s main interface controller:
handleUserActivity:method. Use the provided userInfo dictionary to configure your UI appropriately.
updateUserActivity:userInfo:webpageURL: method tells WatchKit to call the main interface controller’s
handleUserActivity: method at launch time. In your implementation of the
handleUserActivity:method, use the provided contextual data to configure your UI appropriately.
” – Quoted
So the Glance can pass information to the Watch app.
(?) How often the Glance should be updated? And how should it be updated?
As in http://stackoverflow.com/questions/27965917/apple-watch-update-glance-on-background – the Glance can schedule periodic call to update / refresh data.
The data should be saved into Shared Container -> so we can reuse it later.
(?) Can the Watch app pass data to the Glance?
We can just use the data stored in the Shared Container to show on the Glance first.
(?) Can the Glance be scrolled?
No, Glance is not scrollable.
Handoff can be used to share activities between devices. Mac must be Yosemite and devices iOS8 to use Handoff. They must be within 10metres (Bluetooth range), and with Handoff turned on on all devices (Bluetooth on, and Settings-General-Handoff on).
Handoff should mostly transfer what you are doing on the Watch to the iPhone, like opening to the same page. We use Handoff API available inWKInterfaceController in Glance and custom notification interfaces to create deep links in iPhone app.
Package relevant information about what interface is currently doing and pass that to iPhone app so it can present a different interface upon launch!
- Sliders – can use custom images
- Date & Timer Labels
- Menus – up to 4. Each has icon & label (2 lines labels)
- Display Sizes
- 38mm : Width (272 px) – Height (340 px)
- 42mm : Width (312 px) – Height (390 px)
- Not too much information on 1 screen (too hard to read)
- Use visual grouping (and separator lines)
- Use full width & left-align
- Use Menus instead of buttons when possible
- Limit side-by-side controls
- System Font: San Francisco (2 variants: SF Text (19 or smaller) & SF Display (20 or larger)) – font will be switched automatically by the system for you!
- Limit Custom fonts (max 1)
- Use Built-in styles (Headline, Subhead, Body, Caption 1, Caption 2 and Footnote) as they support Dynamic Type -> auto change the spacing, line height for each size. Body – primary content, Footnote/Caption for labels, secondary content.
- Use light colors
- Black background (seemless blending, edge-less content).
- Brand Identity
- Avoid display logo
- No launch screen
- Do not change background color (leave it black)
- Home Screen icon (circular)
- Menu Icons
- Animations: use sequence of images