React native + expo + Notifications = You must provide `notification.vapidPublicKey` in `app.json` to use push notifications on web

Viewed 2260

I've been building an app on RN and static stuff are working as intended. Now I'm trying to add Push Notifications and all tries lead me to this error: You must provide 'notification.vapidPublicKey' in 'app.json' to use push notifications on web..

There are several tutorials around and they all seems so simple and none of them have this error...

So, I've tried 5+ tutorials, using Node 14, react-native-web 0.11.7 (due async issues), including owner, slug and notification.vapidPublicKey on app.json (the last one is not accepted by the file), and a lot of other stuffs, like trying to have this working on a brand new project.

This error occours when I call await Notifications.getExpoPushTokenAsync() from import { Notifications } from 'expo';.

"dependencies": {
  "@expo-google-fonts/inter": "^0.1.0",
  "expo": "~37.0.3",
  "moment": "^2.27.0",
  "react": "~16.9.0",
  "react-dom": "~16.9.0",
  "react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",
  "react-native-screens": "~2.2.0",
  "react-native-web": "0.11.7"
},
"devDependencies": {
  "@babel/core": "^7.8.6",
  "@types/react": "~16.9.23",
  "@types/react-native": "~0.61.17",
  "babel-preset-expo": "~8.1.0",
  "styled-components": "^5.1.1",
  "typescript": "~3.8.3"
},

Any ideas on how to fix this error?

0 Answers
Related