Receive notifications and capture delivery analytics.
The Pushbase SDK offers a hook to listen for incoming notifications and automatically track delivery metrics when notifications are received and opened by users.
app/_layout.tsx
Copy
import React from 'react';import {Slot} from 'expo-router'import {usePushbaseListeners} from '@pushbase/sdk'// Configure how your app will handle notificationNotifications.setNotificationHandler({ handleNotification: async () => ({ shouldShowAlert: true, shouldPlaySound: true, shouldSetBadge: true, }),});export default function Layout() {// Optional enable automatic deep linkingusePushbaseListeners({ enableDeepLinking: true })return <Slot>}
Having trouble setting up or configuring the SDK? Our support team is here to
help — feel free to reach
out