- Expo Router
- React Navigation
app/_layout.tsx
Copy
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>
}
App.tsx
Copy
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>;
}
Having trouble setting up or configuring the SDK? Our support team is here to
help — feel free to reach
out