WatchOS 6 notifications not arriving - apple-push-notifications

I'm wondering if there's a known bug in WatchOS 6.1.1 regarding local notifications triggered from the watch?
I have an app that I developed about two years ago on watchOS 4. It would send local notifications from the watch during background processing. It worked great. The code sat for about two years and I was asked to update it. Since updating, I cannot get local notifications from my watch to work when I distribute builds through TestFlight. When I run the app through Xcode it works (both with the Debug and Release schemes). I saved logs in the watch app that show that the UNUserNotifications.current.add() does not pass an error into its completion handler. I can get local notifications from the handset in TestFlight builds to work and I can mirror those on the watch. But I cannot get local watch notifications to work. Does anyone have any idea why this might be? Is there a known bug? Have local watch notifications changed in a breaking way since watchOS 4?

I've found my issue. I think it's a new bug in watchOS6. It seems that permissions aren't being properly communicated from the handset to the watch. After giving permission for notifications on the handset, I would check for notification permissions on the watch and get .notDetermined. Strangely, if I downloaded the handset app and quickly gave notification permissions BEFORE the watch app had finished downloading, then it properly received notification permissions. I fixed this by simply requesting notification permissions on both the handset and the watch.

Related

iCloud Testing of application in iOS simulator

I am new to the iOS application development and i came across a situation where i need to perform iCloud testing using XCode to check if it is working properly. Can anyone please suggest the steps that needs to be followed in order to perform iCloud testing of iOS application?
You can login to iCloud in the simulator. Open Settings, then login to iCloud just like you would on a device.
I highly recommend using a test account, not your actual account. I also recommend that you have that test account login on a real physical device at least once somewhere to enable additional storage and features on the account.
From that point iCloud should report as available in the simulator.
To trigger a sync with the server, use the "Trigger iCloud Sync" menu item. Simulators don't currently have server-side push notification support so the simulator device is not notified immediately about CloudKit subscriptions.
If you run into any problems please file a feedback report after reproducing the problem, then running xcrun simctl diagnose to gather logs.

ios10 custom push notification sound not playing

I am currently running iOS 10 beta 8 with Xcode 8.0 beta 6 and the custom sound does not play when I receive a push notification with the correct payload.
I have verified the payload and it is in the correct format per the apple documentation:
{
"aps" : {
"alert" : "You got your emails.",
"badge" : 9,
"sound" : "bingbong.aiff"
},
"acme1" : "bar",
"acme2" : 42
}
When I send the same payload to the same build on iOS9 the custom sound plays properly.
Does anyone know if there are any other changes in iOS 10 that I need to make?
This problem seems to only affect apps installed via Xcode. The issue persists even if you later update the app from a different source.
The solution is to completely remove the app, and reinstall it from TestFlight or the App Store.
In effect, this bug should not affect your end users.
Edit 2016-10-15:
Unfortunately it seems that I was mistaken. This appears to be a bug on iOS 10 that can, in fact, affect App Store apps also. If it is of any consolation, apps such as Facebook and WhatsApp are affected too. The solution is apparently to force restart your phone, but unfortunately there doesn't seem to be much we can do about it as developers.
Apple Fixed Issue:
Based on this comment, Apple has seemed to fix the issue in iOS 10.2
Try installing your app using Test Flight and after implementing initial process to update device token just restart your device.
You'll get what you have been looking for.
Credit goes to - binncheol
Having our user restart their device is correcting the issue for us.
This is an issue for us regardless of how the app was installed (TestFlight or from the app store).
There is definitely an iOS10 bug which still persists as of 10.0.2. It affects many apps including popular ones such as Whatsapp and Messenger. The workaround is just to power cycle the device, after which point the notification sounds are correct. It doesn't seem to matter how the app is installed.
I can't find any documentation of this from Apple (go figure) but there is more info here: http://thetechbeard.com/how-to-fix-notification-sound-problem-in-ios-10/.
As reported here lots of other people are having this problem. Hopefully Apple fixes it soon.
I uninstalled the app, turned off the real device, reinstall the app, and then the custom notification sound started working. It didn't work before I restarted my device XD

Proper way to debug watchos2 app in XCode7

I'm rewriting my watch app to work in watchos2 but have problems debugging on the actual watch (XCode7). What is the correct way how to do this?
1) Obvious (but naive) approach - connect your phone with paired watch, in XCode select Extension scheme to run on Phone + Watch. Click play and it should work, right? This seems to work only just after fresh pairing and breaks very quickly (after few debug runs). See issues and behaviour below
2) Run phone app first then add run of extension - this approach worked for me longer but eventually broke as well.
3) Unpair and pair again - more than painful experience, time consuming and not practical at all. Will help for a while though.
Main problems:
phone app not communicating - I've seen not reachable or messages just time out
watch app stops running - XCode is saying it's running but it's not - won't even attach. If I run it manually on watch most of the times it will attach but then the phone app is not reachable
watch app won't even install - I suspect when the XCode is saying it's running it in fact it doesn't because when I remove the app from watch and then run XCode goes through the whole install process and "running" but the icon doesn't even appear on the main screen
phone stops reacting when I use option 2) and try to run something else while app is attached
phone seems to be blocked, selecting other apps (even going back to my app) won't work until I kill the session
Setup: The phone and watch is paired correctly, phone can see watch, watch can see phone, other apps are working. Watch "trusts" the computer as well, app is "shown on apple watch". Phone is 5s 9.0.1.
I've tried various restart combinations (phone|watch|xcode|mac), shuffled cables, disconnect, reconnect, etc. but that didn't help either.
Did anybody find a usable way how to debug watchos2 app from XCode? Nobody else seems to be complaining about this with released XCode7 though I've seen lots of similar issues in beta builds.
Use Apple watch recharging cable, connect your watch to developing Mac that runs Xcode.
It provides much more successful and fast debugging.
I have been dealing with the same issue this last days, I just updated to iOS 9.2, watchOS 2.1 and XCode 7.2, and now everything works.
After update XCode to 7.2, iOS9.2 my phone and WatchOS2.1 my Apple Watch the debug process is better. I suggest to update all your devices.

iOS 9 (13A340) remote notification not working

I am testing an app on iOS 9 (13A340) on iPhone 6, mainly the remote notification part. The remote push notification generated from AWS SNS cannot be received by the app, though the same app on iOS 8 works as expected. Is this due to the beta version of the iOS 9 or?
Thanks for any tip.
/Leonard
I have tried remaking the APSN development certificate and etc. and then it starts working, although I don't know what problem really was.
This didReceiveRemoteNotification method may also be called if a “silent/background” notification is received. As such, you should also enable “Background Modes: Remote Notifications” in the target capabilities panel (or else you’ll see warnings in the console).
Read more: http://www.intertech.com/Blog/push-notifications-tutorial-for-ios-9/#ixzz3tH8pRbz0
check image description here

Local Notification is cleared from notification center after clicking the notification in iOS 8

UILocalNotification is cleared from the notification center after clicking in iOS 8. But it is not cleared from notification center in iOS 7. Can I know what makes the notification clear from center?
i dont have this behavior but i did have it with location services as you said...in that case it seems that the plugin was not working properly so i had to create the project from scratch (after updating cordova to latest) then added each plugin, that fixed my problem with location services BUT now i have a problem with local notification, again i dont see the option at all in my settings, but since you are seeing it this might be related with your app being installed just where prior (iOS7 installation) was in that case it make sense that if you delete you app you will NO see your app in local notification settings at all... this is definitively related with local-notification-cordova-plugin being a pain in the neck to work properly now im really sad to see that iOS8 is conflictive with the plugin i barely found...now i'm not sure what to do, if you find a local-notification-plugin that works with iOS8 PLEASE let me know!

Resources