You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to filter some push notifications according to Apple documentation.
Subclassing from BrazeNotificationService.NotificationService in NotificationServiceExtension doesn't allow me to override UNNotificationServiceExtension.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:
Hey @PlanesWalkerr, it sounds like you're trying to add your own custom logic in UNNotificationServiceExtension.didReceive(_:withContentHandler:), is that correct?
The Braze implementation of that method calls the brazeHandle method, which is publicly available. What you could do instead of directly inheriting from BrazeNotificationService.NotificationService is to simply implement UNNotificationServiceExtension yourself, and when you override didReceive(_:withContentHandler:), you can call the brazeHandle method, along with your own custom logic.
The minimal implementation on that page should describe how the method would look like, but in summary, it would be something like this:
classYourNotificationService:UNNotificationServiceExtension{overridefunc didReceive(
_ request:UNNotificationRequest,
withContentHandler contentHandler:@escaping(UNNotificationContent)->Void){
if brazeHandle(request: request, contentHandler: contentHandler){return}// Your custom logiccontentHandler(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: