Push Notifications · Badging the App Icon | raywenderlich.com

This is a companion discussion topic for the original entry at https://www.raywenderlich.com/1258151-push-notifications/lessons/16

Please attachment source code.

hi! there should be course materials … I’ll ask the editors to set up links.

thanks for posting!

Update: There’s only one set of course materials for Part 2. You can download them from episode 12 Notification Service Extension. This link might work, too.

How do you reset the badge icon to zero? I can’t access the badge from the controller that I send the user to upon tapping the notification.

Hi Jose! you can access UserDefaults from anywhere. It’s built into Foundation. Reset UserDefaults.extensions.badge.

That was an incredibly quick reply. Thanks!. I have tried that. Tried also making “extensions” optional but I still get a fatal error: Fatal error: Unexpectedly found nil while unwrapping an Optional value

Never mind. Found my mistake. Missed “group.” from suiteName in “group.com.domainName.appName”.

1 Like

great! it turns out macOS doesn’t include php anymore, and I don’t usually have homebrew installed, so that’s happening now.