Push Notification
iOS
Configuring Expo Push Notifications for iOS
iOS
Android
Make sure you update the Configure
config.ts
home.tsx
Configuration
Make sure you update the Configure config.ts
:
const config = {
// other configurations
// This is the bundle identifier of your ios App
appIdPrefix: "com.expostarter.app",
}
Set up Apple Push Notification service (APNs)
With eas-cli
Manually
Implement push notification handling
The project is pre-configured to present the user with a permission dialog when the user is first connected.
You can also trigger the permission dialog by calling setAppPreferences
anywhere in your code :
export default function App() {
const setAppPreferences = useSetAppPreferences();
return(<Button onPress={() => {
setAppPreferences({
enableNotifications: true,
hasPromptedForNotifications: true,
});
}}
>
<Text>
Enable Notification
</Text>
</Button>)
}
Test your setup
Run your application on a device; simulators are not supported.
pnpm ios -d
Token will be stored and attached to the user in the backend