为什么Firebase在Android模拟器上运行时会在PhoneGap应用中返回404错误? [英] Why is Firebase returning 404 errors in PhoneGap app when running on Android emulator?

查看:399
本文介绍了为什么Firebase在Android模拟器上运行时会在PhoneGap应用中返回404错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在PhoneGap应用程序中使用Firebase + Firebase简单登录,当我在Android模拟器中运行应用程序(基于浏览器的测试工作正常)时出现问题。

I am using Firebase + Firebase Simple Login in a PhoneGap app and am having issues when I run the app in an Android emulator (browser-based testing works fine).

注意:我之前遇到了此问题,但我添加了cordova.js和没有孤独的安全限制警告。

Note: I ran into this issue earlier, but I added cordova.js and no loner see the security restrictions warning.

现在发生的是404错误回复,我不知道该怎么做。

All that is happening now is 404 error responses and I'm not sure what to do about it.

推荐答案

您需要将firebase.com添加到应用的白名单中。

You need to add firebase.com to your app's whitelist.

假设您正在使用PhoneGap 3.x +步骤:

Assuming you're using PhoneGap 3.x+, follow these steps:


  1. 编辑 config.xml (请参阅 Cordova的文档了解该文件所在位置的详情)

  2. 添加允许firebase和子域的规则:

  1. Edit config.xml (see Cordova's docs for more about where that file lives)
  2. Add a rule allowing firebase and subdomains:

<access uri="https://*.firebaseio.com" subdomains="true" />


您可能还会发现这个问题有用。它有一堆东西在白金列入Cordova / PhoneGap。

You might also find this question helpful. It has a bunch of stuff in it about whitelisting in Cordova / PhoneGap.

这篇关于为什么Firebase在Android模拟器上运行时会在PhoneGap应用中返回404错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆