🔔

Push Notifications

👨‍🍳 Chef⏱️ 25 minutes

📋 Suggested prerequisites

  • •Expo app
  • •Backend

What you'll build

A push notification system that sends alerts to your users' phones even when they're not using the app. You'll implement the complete flow: request permissions from the user, get the Expo Push token, save it to your backend, and send personalized notifications from your server. When finished, you'll be able to send notifications with title, message, and extra data that open specific screens of your app when the user taps them.


With Expo Push

npx expo install expo-notifications expo-device

Get token

import * as Notifications from 'expo-notifications'
import * as Device from 'expo-device'

async function registerForPush() {
  if (!Device.isDevice) return

  const { status } = await Notifications.requestPermissionsAsync()
  if (status !== 'granted') return

  const token = await Notifications.getExpoPushTokenAsync()
  // Save token to your backend
  return token.data
}

Send from backend

await fetch('https://exp.host/--/api/v2/push/send', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    to: 'ExponentPushToken[xxx]',
    title: 'New message',
    body: 'You have a new message',
    data: { screen: 'Chat' }
  })
})

Next step

→ Webhook Receiver

Enjoyed cooking this?

Learn to imagine the tool and build it

GenAI Builder takes you from following recipes to designing your own: ten domains, five levels you earn by doing, evidence-based challenges and an AI mentor.

See the courseLifetime access · 30-day guarantee

© 2026 luxIA.us - All rights reserved

Created by Alann Reyes