-
Notifications
You must be signed in to change notification settings - Fork 17
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
[Feature]: Enable filtering push notifications #94
Comments
Hey @PlanesWalkerr, it sounds like you're trying to add your own custom logic in The Braze implementation of that method calls the The minimal implementation on that page should describe how the method would look like, but in summary, it would be something like this: class YourNotificationService: UNNotificationServiceExtension {
override func didReceive(
_ request: UNNotificationRequest,
withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void
) {
if brazeHandle(request: request, contentHandler: contentHandler) {
return
}
// Your custom logic
contentHandler(request.content)
}
} Let us know if that implementation works for your use case, and if so, feel free to close this issue! Thank you! |
What problem are you facing?
I want to filter some push notifications according to Apple documentation.
Subclassing from
BrazeNotificationService.NotificationService
inNotificationServiceExtension
doesn't allow me to overrideUNNotificationServiceExtension.didReceive(_:withContentHandler:)
method. Is there any way to filter push notifications?Workarounds
Seems like it's not possible in current version.
Ideal Solution
Maybe add optional handler where an app can decide if push notification should be shown
Other Information
No response
The text was updated successfully, but these errors were encountered: