3

We are using the UNUserNotification framework provided by WatchOS 3.0 to create local notification to notify user at a predefined moment. However, the notification is not shown when the watch is not being worn on the wrist. It does work well when someone is wearing it.

We cannot find this description on any documentation. Is that normal? If yes, how to help the user to avoiding missing some notifs ?

UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { (granted, error) in
            // Enable or disable features based on authorization.
            if granted {
                let content = UNMutableNotificationContent()
                content.title = title
                content.body = body
                content.sound = UNNotificationSound.default()
                content.userInfo = userInfo
                let trigger = UNTimeIntervalNotificationTrigger.init(
                    timeInterval: interval,
                    repeats: false)

                let identifier = stringWithUUID()
                let request = UNNotificationRequest.init(
                    identifier: identifier,
                    content: content,
                    trigger: trigger
                )
                UNUserNotificationCenter.current().add(request, withCompletionHandler: nil)
                completion?(true, nil)
            }
            else {
                completion?(false, error)
            }
        }
Jibeex
  • 5,509
  • 3
  • 27
  • 37

1 Answers1

2

This is normal, Apple Watch automatically locks when you take it off your wrist and notifications go to your iPhone instead.

Curiosity
  • 544
  • 1
  • 15
  • 29
  • 1
    This is described here: https://developer.apple.com/library/content/documentation/General/Conceptual/WatchKitProgrammingGuide/BasicSupport.html#//apple_ref/doc/uid/TP40014969-CH18-SW1 – abjurato Apr 12 '17 at 14:30
  • 2
    Yes, according to this documentation, if the source of the notification is the Watch Extension, it's delivered only to the watch. The problem is if such a notification happens when the user is not wearing the watch, it gets lost forever....... – André Henrique Apr 29 '17 at 05:22