1

Hi I am developing app which supports both iphone and watch. I am registering for usernotifications from iphone app as below. On Recieving PUsh notifications i am able to get notificaitonsto iphone quckly 1 to 2 secs. But for watch its taking a delay of 20 secs every time. I Tried unpariring and restarting the devices but dint work Please suggest me what should be done to get notifications quickly on watch side. I am using iOS 13.2.2 and watch os - 6.1

  {
        let approveAction = UIMutableUserNotificationAction()
        approveAction.title = NSLocalizedString("Approve", comment: "Notification approve button title")
        approveAction.identifier = "approve"
        approveAction.isDestructive = false
        approveAction.activationMode = .background
        approveAction.isAuthenticationRequired = false


        let denyAction = UIMutableUserNotificationAction()
        denyAction.title = NSLocalizedString("Deny", comment: "Notification deny button title")
        denyAction.identifier = "deny"
        denyAction.isDestructive = true
        denyAction.activationMode = .background
        denyAction.isAuthenticationRequired = false

        let signInCategory = UIMutableUserNotificationCategory()
        signInCategory.setActions([approveAction, denyAction], for: .default)
        signInCategory.identifier = "pushotp"

        let categories = NSSet(object: signInCategory) as? Set<UIUserNotificationCategory>

        let settings = UIUserNotificationSettings(types: [.badge, .sound, .alert], categories: categories)
        DispatchQueue.main.async(execute: {
            UIApplication.shared.registerUserNotificationSettings(settings)
        })
    } 
kumar
  • 73
  • 9
  • I've had issues with local watch notifications not being delivered at all. Did you figure out what your issue was? – rharding Jan 29 '20 at 20:36
  • Hi @RossHarding I am trying to figure out, dint get any solution. But at least I am able to get notifications in 2 to 3 secs when I used iPhone 10 and production build. But if I test the same in iPhone 7 , iPhone 6s the delay is alsmost 20 secs. I will keep posting if I get any solution. – kumar Feb 05 '20 at 11:46
  • I found that my issue was that in watchOS 6 the notification permission wasn't being transferred to the watch when granted on the phone. I had to request permissions on both devices. Sounds like we're having different issues. Good luck – rharding Feb 05 '20 at 15:10

0 Answers0