Skip to content

Commit

Permalink
minor readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaysubra committed Mar 26, 2024
1 parent a826b6f commit adcf1fc
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,23 @@ When tracking opened push notification, you can also decrement the badge count o
}
}
```

Additionally, if you just want to reset the badge count to zero when the app is opened(note that this could be from
the user just opening the app independent of the push message), you can add the following code to
the `applicationDidBecomeActive` method in the app delegate:

```swift
func applicationDidBecomeActive(_ application: UIApplication) {
// reset the badge count on the app icon
if #available(iOS 16.0, *) {
UNUserNotificationCenter.current().setBadgeCount(0)
} else {
UIApplication.shared.applicationIconBadgeNumber = 0
}
}
```

Once your first push notifications are sent and opened, you should start to see _Opened Push_ metrics within your Klaviyo dashboard.

#### Deep Linking
Expand Down

0 comments on commit adcf1fc

Please sign in to comment.