Automatic (the default)
Like the OneSignal, Firebase and Braze SDKs, ours hooks the system callbacks when you callconfigure, so none of this needs app code:
- Device tokens. Your app delegate’s token callback is hooked, and the token is registered with your bundle id and the right APNs environment (read from the build’s provisioning profile, so Xcode and TestFlight builds are told apart correctly). The SDK also re-registers on every launch once permission is granted, so tokens never go stale.
- Taps and dismissals. Your
UNUserNotificationCenterDelegate’sdidReceiveis hooked (or one is provided if you never set a delegate). Your own implementation is always called, so your deep-link routing keeps working. Our notifications are reported as$notification_tappedor$notification_dismissed. - The dismiss category. iOS only reports swipe-to-dismiss for notification
categories registered with
.customDismissAction. The SDK adds its category to the ones you already registered, and never replaces them.
Tap destinations
A flow’s message can carry a deep link. When the user taps, iOS hands the notification to your delegate as usual, with the link under thedeep_link
key for your router to open:
Custom data
A message’s custom data arrives as top-level keys in the notification’suserInfo, next to deep_link. Values set in a
flow are always strings:
willPresent.
Manual integration
Turn the hooks off if another SDK’s swizzling conflicts with ours, or your delegate setup needs to be explicit:handleNotificationResponse never calls the completion handler for you, and
returns whether the notification came from PushNotifAI.
If your app sets its whole category list with setNotificationCategories
(which replaces whatever was there), also set
automaticallyRegistersNotificationCategory: false and include ours: