examples/user-management/expo-push-notifications/README.md
Expo makes implementing push notifications easy. All the hassle with device information and communicating with Firebase Cloud Messaging (FCM) or Apple Push Notification Service (APNs) is done behind the scenes. This allows you to treat Android and iOS notifications in the same way and save time both on the frontend and backend.
supabase link --project-ref your-supabase-project-refsupabase startsupabase db push (schema is defined in supabase/migrations)To utilize Expo's push notification service, you must configure your app by installing a set of libraries, implementing functions to handle notifications, and setting up credentials for Android and iOS. Follow the official Expo Push Notifications Setup Guide to get the credentials for Android and iOS. This project uses Expo's EAS build service to simplify this part.
npm inpm install --global eas-cli && eas init --id your-expo-project-idnpx expo start --dev-client.env file: cp .env.local.example .env.local.env.local file, set your EXPO_ACCESS_TOKEN value.The database webhook handler to send push notifications is located in supabase/functions/push/index.ts. Deploy the function to your linked project and set the EXPO_ACCESS_TOKEN secret.
supabase functions deploy pushsupabase secrets set --env-file .env.localNavigate to the Database Webhooks settings in your Supabase Dashboard.
notifications table and tick the Insert event.push edge function and leave the method as POST and timeout as 1000.application/json.notifications table, insert a new row.