Documentation Index
Fetch the complete documentation index at: https://docs.pushbase.dev/llms.txt
Use this file to discover all available pages before exploring further.
The Pushbase SDK offers a hook to listen for incoming notifications and automatically track delivery metrics when notifications are received and opened by users.
Expo Router
React Navigation
import React from 'react';
import {Slot} from 'expo-router'
import {usePushbaseListeners} from '@pushbase/sdk'
// Configure how your app will handle notification
Notifications.setNotificationHandler({
handleNotification: async () => ({
shouldShowAlert: true,
shouldPlaySound: true,
shouldSetBadge: true,
}),
});
export default function Layout() {
// Optional enable automatic deep linking
usePushbaseListeners({ enableDeepLinking: true })
return <Slot>
}
import React from "react";
import * as Notifications from "expo-notifications";
import { NavigationContainer } from "@react-navigation/native";
import { usePushbaseListeners } from "@pushbase/sdk";
// Configure how your app will handle notification
Notifications.setNotificationHandler({
handleNotification: async () => ({
shouldShowAlert: true,
shouldPlaySound: true,
shouldSetBadge: true,
}),
});
export default function App() {
// Optional enable automatic deep linking
usePushbaseListeners({ enableDeepLinking: true });
return <NavigationContainer>{/* Your content here */}></NavigationContainer>;
}