0

Is there a way to find out if a local notification with background actions was responded to on the iPhone vs. on the Apple Watch. In both cases they are handled by the iPhone App userNotificationCenter(_:didReceive:withCompletionHandler:). Is this information somehwere accesible, maybe in the UNNotificationResponse?

Mirko Fetter
  • 186
  • 1
  • 13

1 Answers1

0

AFAIK the UserNotification framework doesn't have such method at the moment.

However, you could check whether the notification handling code is run in your main app or on your Watch Extension and use that information to take appropriate actions.

See this question on how to determine where your code is running.

Dávid Pásztor
  • 51,403
  • 9
  • 85
  • 116
  • Thanks, but as far as i understood, the notification handling for **background actions** is always in the iPhone App `userNotificationCenter(_:didReceive:withCompletionHandler:)`. So, i guess the link does not really help in my case. – Mirko Fetter May 31 '17 at 16:40