我如何将 Firebase 与 Expo 结合使用

时间:2020-12-19 09:20:41

标签: node.js react-native expo react-native-web

目前 Expo 仅支持 Android 和 iOS 的推送通知。如何使用 Firebase 实施推送通知?

1 个答案:

答案 0 :(得分:0)

要为 Expo web 实施 Firebase,您需要执行以下操作:

  1. 确保您使用的是至少 Expo 39.0.4。见How to avoid loading Expo notifications bundle for web build?
  2. 确保您使用的是最新版本的 Firebase npm install firebase@latest
  3. 使用 register-service-worker.js
  4. 创建您的 expo customize:web 文件
  5. 使用以下 Github 存储库作为参考更新您的代码:expo-fcm-pwa