The direct url got the 404 :
https://exp.host/--/api/v2/push/send
---
title: Push Notifications
---
Push Notifications are an important feature to, as _"growth hackers"_ would say, retain and re-engage users and monetize on their attention, or something. From my point of view it's just super handy to know when a relevant event happens in an app so I can jump back into it and read more. Let's look at how to do this with Expo. Spoiler alert: it's almost too easy.
> **Note:** iOS and Android simulators cannot receive push notifications, to test them out you will need to use a real-life device. Additionally, when calling Permissions.askAsync on the simulator, it will resolve immediately with "undetermined" as the status, regardless of whether you choose to allow or not.
There are three main steps to wiring up push notifications: sending a user's Expo Push Token to your server, calling Expo's Push API with the token when you want to send a notification, and responding to receiving and/or selecting the notification in your app (for example to jump to a particular screen that the notification refers to).
## 1. Save the user's Expo Push Token on your server
In order to send a push notification to somebody, we need to know about their device. Sure, we know our user's account information, but Apple, Google, and Expo do not understand what devices correspond to "Brent" in your proprietary user account system. Expo takes care of identifying your device with Apple and Google through the Expo push token, so all we need to do is send this to your server so you can associate it with the user account and use it in the future for sending push notifications.
```javascript
import { Permissions, Notifications } from 'expo';
const PUSH_ENDPOINT = 'https://your-server.com/users/push-token';
async function registerForPushNotificationsAsync() {
This file has been truncated. show original
Already solved it, it was 2 problem:
a) Iām using Postman, page only available in POST, so changed to POST
b) Change syntax of JSON query, postman sensitives to quotes
@methos2018 Glad you got it resolved! Thanks for sharing the solution as well.
Cheers,
Adam
1 Like
system
closed
July 26, 2018, 4:43pm
#4
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.