Issue with Expo's Online Push Notification Tester

thank you @ide … i suspect that the reason the form is not working, is the same reason why my programmatic network requests are not working… please see this recent Expo forum post.

expo v25
ios 11.1
expo ios client app @ latest

in Postman and/or cURL, it works great, even when the headers are incomplete:

method: 'POST',
headers: {
 'Content-Type': 'application/json'
}

on a side note, as per docs, complete headers should be:

method: 'POST',
headers: {
 'Content-Type': 'application/json',
 'Accept': 'application/json',
 'Accept-Encoding': 'gzip, deflate'
}

In Postman, this is what I am sending over as “raw” data:

{
	"to": "ExponentPushToken[...omitted for security reasons...]",
    "body": "push notification test"
}

and it works perfectly, every time, no issues. Anyway, below is what I think you are asking for:

My app’s dependencies…

"dependencies": {
    "axios": "^0.16.2",
    "expo": "^25.0.0",
    "moment": "^2.20.1",
    "react": "16.2.0",
    "react-apollo": "^1.4.8",
    "react-native": "https://github.com/expo/react-native/archive/sdk-25.0.0.tar.gz",
    "react-native-dotenv": "^0.1.0",
    "react-native-indicator": "^0.7.0",
    "react-native-is-iphonex": "^1.0.1",
    "react-native-keyboard-aware-scroll-view": "^0.4.3",
    "react-native-modal": "^2.5.0",
    "react-native-swiper": "^1.5.13",
    "react-navigation": "^1.1.2",
    "react-redux": "^5.0.6",
    "redux": "^3.7.2",
    "redux-thunk": "^2.2.0",
    "subscriptions-transport-ws": "^0.8.2",
    "underscore": "^1.8.3"
  }

My app’s syntax…

componentDidMount(){
    this.registerForPushNotificationsAsync()
  }

  componentWillUnmount() {
    this.notificationSubscription && this.notificationSubscription.remove()
  }
  
  async registerForPushNotificationsAsync(){
    const { status } = await Permissions.getAsync(Permissions.NOTIFICATIONS)
    if (status === 'granted') {
      this.getPushToken()
    } else {
      let { status:newStatus } = await Permissions.askAsync(Permissions.NOTIFICATIONS)
      newStatus === 'granted' ? this.getPushToken() : this.updatePushTokenInDb(null)
    }
  }
  
  async getPushToken(){
    let token = await Notifications.getExpoPushTokenAsync()
    token && this.updatePushTokenInDb(token)
  }
  
  updatePushTokenInDb(token){
    // omitted from expo forum
  }
  
  createNotificationSubscription(){
    this.notificationSubscription = Notifications.addListener(
      this.handleNotification
    )
  }

  handleNotification = (notification) => {
    console.log(notification)
  }

Fields that I’m filling out in your form:

EXPO PUSH TOKEN (FROM YOUR APP): ExponentPushToken[...omitted for security reasons...]
MESSAGE TITLE: my title
MESSAGE BODY: my message
PLAY SOUND: checked // fails whether checked or unchecked
JSON DATA: {"any": "any"} // fails whether blank or populated
TTL (SECONDS): 0 // fails whether blank, or numbers  >=  0
BADGE COUNT: 1 // fails whether blank, or numbers  >=  0
CONTENT AVAILABLE (for background update notifications): checked // fails whether checked or unchecked

I think it would be helpful if this form parsed the following type of response under the checked green button so there’s more programmatic visual confirmation:

{
  "data": [
    {"status": "ok"}
  ]
}

but again, i suspect that the reason that the form is having trouble either posting the request, or triggering expo’s Notifications.addListener, is very related to the other issue i’m having with failed POST requests at your Push API’s endpoint. Please visit this expo forum post for more details.

Important Side Note Question…
For the field in your test form labeled “CONTENT AVAILABLE (for background update notifications)”, to which object field does this correlate to in the outbound message format defined at the link below???
https://docs.expo.io/versions/v25.0.0/guides/push-notifications.html#message-format