getExpoPushTokenAsync() returning 400 error

Please provide the following:

  1. SDK Version: 38.0.8
  2. Platforms(Android/iOS/web/all): iOS

First off thanks so much for all the work you do on Expo. It is a fantastic platform.
I have made a few expo apps in the past (1-2 years ago) and recently fired it up again for a side project. I am trying to get notifications working and am running into an error that I can’t find any docs on. Here is the error:

[Unhandled promise rejection: Error: Error encountered while fetching Expo token, expected an OK response, received: 400 (body: "{"errors":[{"code":"API_ERROR","message":"\"value\" must be of type object."}]}").]
* [native code]:null in construct
- node_modules/@babel/runtime/helpers/construct.js:19:9 in _construct
- node_modules/@babel/runtime/helpers/wrapNativeSuper.js:26:22 in Wrapper
* [native code]:null in construct
* http://192.168.1.67:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:107368:321 in _createSuperInternal
- node_modules/@unimodules/react-native-adapter/build/errors/CodedError.js:8:8 in constructor
- node_modules/expo-notifications/build/getExpoPushTokenAsync.js:7:15 in getExpoPushTokenAsync
- node_modules/regenerator-runtime/runtime.js:45:36 in tryCatch
- node_modules/regenerator-runtime/runtime.js:274:29 in invoke
- node_modules/regenerator-runtime/runtime.js:45:36 in tryCatch
- node_modules/regenerator-runtime/runtime.js:135:27 in invoke
- node_modules/regenerator-runtime/runtime.js:145:18 in PromiseImpl.resolve.then$argument_0
- node_modules/promise/setimmediate/core.js:37:13 in tryCallOne
- node_modules/promise/setimmediate/core.js:123:24 in setImmediate$argument_0
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:135:14 in _callTimer
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:183:16 in _callImmediatesPass
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:446:30 in callImmediates
* [native code]:null in callImmediates
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:396:6 in __callImmediates
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:144:6 in __guard$argument_0
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:373:10 in __guard
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:143:4 in flushedQueue
* [native code]:null in flushedQueue
* [native code]:null in invokeCallbackAndReturnFlushedQueue

I am using the exact code in the notifications example – https://docs.expo.io/versions/latest/sdk/notifications/ and running on my iPhone X. I have also tried running the Push Notifications snack from the link in the notifications page (https://snack.expo.io/@shkurkin/c10b13) with seemingly the same issue (can’t see error thrown but don’t get an expo push token). I have tried the first tier of tech support (turning it off and on again, deleting and reinstalling expo ios app, console logging stuff) but this error remains opaque to me. Anyone else experiencing the same?

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.