Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #167

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- [Request Push Notification Permission](#request-push-notification-permission)
- [Receiving Push Notifications](#receiving-push-notifications)
- [Tracking Open Events](#tracking-open-events)
- [Updating the badge](#updating-the-badge)
- [Deep Linking](#deep-linking)
- [Option 1: URL Schemes](#option-1-URL-schemes)
- [Option 2: Universal Links](#option-2-universal-links)
Expand Down Expand Up @@ -312,6 +313,18 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
```
Once your first push notifications are sent and opened, you should start to see _Opened Push_ metrics within your Klaviyo dashboard.

#### Updating the badge

If badge permissions were requested when requesting push permission please use the following code to decrement the badge count when handling opened push.

```swift
if #available(iOS 16.0, *) {
UNUserNotificationCenter.current().setBadgeCount(UIApplication.shared.applicationIconBadgeNumber - 1)
} else {
UIApplication.shared.applicationIconBadgeNumber -= 1
}
```

#### Deep Linking

> ℹ️ Your app needs to use version 1.7.2 at a minimum in order for the below steps to work.
Expand Down
Loading