1

i have an app that its configured to receive remote notifications. Before iOS 10 release everything was working fine on iOS and WatchOS side (push notification uses localised message and custom sound)

After release of iOS 10 and WatchOS 3 i had to add code that asks for push permissions using UserNotification framework (otherwise system will not provide push token, even tho old code isn't deprecated)

Worst of all if i have my watch app running when remote notification arrives - watches will reboot with apple logo. So push notification isn't crashing app itself, it crashes whole watch OS. Any ideas?

3 Answers3

0

Have you checked your app capabilities and certificates are all OK?

I have a similar setup for one of my apps (using remote notifications), and I haven't needed to update the notification registration code to use the new UserNotification framework - it works as before on iOS10.

Xcode 8 is slightly different in how it tries to help manage your certificates and maybe something got messed up?

John Pollard
  • 432
  • 5
  • 11
  • Certificates are working because iPhone is able to receive push notifications with unlocked screen. But when screen is locked - push is sent to Apple Watch, which reboots is companion app is open on a watch – Aleksey Mazurenko Oct 12 '16 at 08:58
  • Do you have a notification handler in your watch app that could be causing the crash? I haven't looked at implementing that, so I just get a "normal" notification shown on the watch, and don't do anything with it. – John Pollard Oct 12 '16 at 09:50
  • I've tried with and without, system crashes before my methods get a chance to execute – Aleksey Mazurenko Oct 12 '16 at 15:20
  • Don't have any more ideas I'm afraid :( Good luck in tracking it down, and let me know if I can help more in any way – John Pollard Oct 13 '16 at 08:04
0

I was having the same issue, and the thing causing crash was "url" value of user info being null. I asked my back-end dev to make it just empty string and everything worked

0

Found a problem. Following payload causes Apple Watch to reboot

{
aps =     {
    alert =         {
        "loc-args" =             (
            Test,
            "<null>",
            Test,
            4147
        );
        "loc-key" = "test";
    };
    category = "test";
    sound = default;
};
}

If i replace "<null>" with " " - crash will go away