Companion Apple Watch App local notifications delayed?

I have an app for Apple Watch as a companion app for an iPhone app. The local notifications on Apple Watch App are delayed. I scheduled a local notification to be fired after 10 seconds. When I press the button on the watch that creates the notification and I exit the app, it doesn't take 10 seconds to display the notification but about 23 seconds.

I created a test stand alone/independent Apple Watch App with the same local notification code, and in this scenario, the local notification fires at the correct time.

I am on watchOS 8.1. Is this a new feature on Apple Watch or a bug? Because on iPhone it works without any delay. Thank you in advance :)

// Configure the notification's payload. 
let content = UNMutableNotificationContent()
    content.title = "Drink some milk!"
    content.subtitle = "you have 10 sec"
    content.sound = .default
    content.categoryIdentifier = "myCategory"
    let category = UNNotificationCategory(identifier: "myCategory", actions: [], intentIdentifiers: [], options: [])
    UNUserNotificationCenter.current().setNotificationCategories([category])
    let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 10, repeats: false)
    let request = UNNotificationRequest(identifier: "milk", content: content, trigger: trigger)
     
    UNUserNotificationCenter.current().add(request) { (error) in
      if let error = error{
        print(error.localizedDescription)
      }else{
        print("scheduled successfully")
      }
    }
  • Same issue here, WatchOS 8.3. What's even funnier, same code runs fine on one of my apps (standalone app), but not the other (well, also standalone but bundled with an iPhone app). The code runs fine on watch simulator and iPhone but on a real device there's a delay.

    Upon searching here and there, it seems that the bug would come and go every so often (introduced WatchOS 6 or before, fixed WatchOS 6.1), even the delay matches (10, 13, up to 15 seconds) "historical data".

  • Checked my release. Funnily enough, when I uninstall iPhone version (as I mentioned, bundled but standalone) the notifications on the Watch start to arrive precisely on time.

Add a Comment

Replies

same issue, watchOS 8.3

  • thanks to FelixII answer.

    There is a temporary solution: If watch app send local notification , I'll send the notification 13 seconds ahead of time. This way the notification appears to be on time Hope to have a better solution in the future

Add a Comment

I'm experiencing the same issue since watchOS 8.0. I've submitted a bug report: FB9842030

I'm also experiencing this frustrating issue. I have a use case where this time delay is important :( Please fix Apple! Issue persists on WatchOS 8.4.1

I have received the following feedback from Apple:

This is correct behaviour.

If you have both a phone and watch app installed we’ll try to coordinate between phone and watch notifications if the phone is unlocked. If the app developer doesn’t send a notification on the phone the watch will timeout after 13 seconds and alert anyway.

The best solution to this would be to send the same notification on both devices ensuring the UNNotificationRequest.identifier matches on a per-instance basis.

This will let us alert and deduce correctly.

  • Thank you for sharing the feedback! How can we match the identifier "on a per-instance basis"? I tried to give both identifiers different names with "#if os.." but it doesn't work. There is still a 13 second delay.

Add a Comment