首页 \ 问答 \ Firebase数据库setValue:或removeValue失败:permission_denied iOS(Firebase Database setValue: or removeValue failed: permission_denied iOS)

Firebase数据库setValue:或removeValue失败:permission_denied iOS(Firebase Database setValue: or removeValue failed: permission_denied iOS)

我正在尝试将数据写入Firebase数据库,但按下保存的按钮时,我仍然收到以下错误消息。

2016-12-02 11:09:42.548 StartupNow [1482:60415] [FirebaseDatabase] setValue:or removeValue:at / test / -KY-VpLZWbp4vjF3BpMk failed:permission_denied

我试过的东西:我已经确保我的.read和.write规则在我的控制台中设置为true,重新连接了我的savedButtonPressed按钮,并将Firebase引用写入函数中,并在我的savedButtonPressed()方法中调用它。

额外的资源这里是我正在遵循的教程。 https://youtu.be/F42CzqIBxHQ?t=4m14s

var ref: FIRDatabaseReference?

override func viewDidLoad() {
    super.viewDidLoad()

    ref = FIRDatabase.database().reference()

}

@IBAction func saveButtonPressed() {
   // TODO: Post data to Firebase

    firebaseChild()
    print("********************************")
    print("********************************")

}

func firebaseChild () {
    ref?.child("Test").childByAutoId().setValue("Hello Firebase")

}

I'm trying to write data to Firebase Database but I keep receiving the following error when my saved button is pressed.

2016-12-02 11:09:42.548 StartupNow[1482:60415] [FirebaseDatabase] setValue: or removeValue: at /test/-KY-VpLZWbp4vjF3BpMk failed: permission_denied

Things I've tried: I've made sure my .read and .write rules were set to true in my console, reconnected my savedButtonPressed button, and wrote the Firebase reference in a function and called it in my savedButtonPressed() method.

Extra Resource Here is the tutorial I'm following along. https://youtu.be/F42CzqIBxHQ?t=4m14s

var ref: FIRDatabaseReference?

override func viewDidLoad() {
    super.viewDidLoad()

    ref = FIRDatabase.database().reference()

}

@IBAction func saveButtonPressed() {
   // TODO: Post data to Firebase

    firebaseChild()
    print("********************************")
    print("********************************")

}

func firebaseChild () {
    ref?.child("Test").childByAutoId().setValue("Hello Firebase")

}

原文:https://stackoverflow.com/questions/40937868
更新时间:2022-11-22 07:11

最满意答案

正如阿什利的回答中提到的那样,我的问题无法解决我想要的方式。 一些节点包仅用于服务器而不是浏览器...


As it was mentioned in the answer of the Ashley, my problem is irresolvable the way I wanted. Some node packages are only made for servers and not browsers...

相关问答

更多
  • 是的,Aurelia有一个EventAggregator。 您可以在此演示应用程序中查看其使用示例: https : //github.com/aurelia/app-contacts 看起来DevExpress控件利用knockout进行数据绑定。 可以教Aurelia的绑定引擎与Knockout一起工作。 这是一个示例适配器: https : //github.com/jdanyow/aurelia-knockout Aurelia是用ES6 / 7编写的,不提供类型安全性。 我们有.d.ts文件用于T ...
  • 安装jspm命令行界面。 jspm是客户端依赖的包管理器。 阅读它...这很棒 npm install jspm -g 为项目创建一个文件夹。 mkdir minimal cd minimal 初始化jspm客户端包管理...接受所有默认值EXCEPT使用Babel transpiler选项(vs Traceur) jspm init 通过在config.js( jspm init创建config.js文件)中的babelOptions中添加以下命令,启用所有奇特的前沿功能: System.confi ...
  • 克隆Aurelia骨架导航项目 。 这提供了一个完整的Aurelia示例应用程序。 它基本上是您需要的一切,只需很少的努力即可启动并运行基础Aurelia客户端项目。 接下来,从Node.js Express应用程序中提供Aurelia示例应用程序客户端文件 Clone the Aurelia skeleton navigation project. This provides a complete Aurelia sample app. It's essentially everything you ne ...
  • 检查cli代码,为了让它工作你应该在platform下的"hmr": true设置"hmr": true 。 并调用au run --hmr --watch 。 编辑:它无法更新我的HTML(虽然控制台通过列出我所做的所有更改向我显示hmr处于活动状态) edit2:我认为当你实际使用1个以上的模块时这是有效的。 app.html中的app.html仅未反映回浏览器。 inspecting the cli code, to get it to work you should set "hmr": true ...
  • 我的猜测是你从CLI开始你的项目 - 它预设了HTTP服务器,ES6 / 2015,SASS,实时重新加载等等。 我创建了干净的Aurelia项目并查看了package.json - 有5个依赖项和34个dev依赖项。 使用上述所有工具在当今的JS Web开发中是标准的,从CLI生成项目可以减少前期设置所需的时间。 所有这些功能都有自己的依赖关系,这就是node_modules/文件夹快速增长的原因。 底线是 - 你可以用更少的依赖开始新的Aureila项目。 在他们的主页上,你可以找到只有三个的入门项目 ...
  • MomentJS是一个全局模块,仅输出一个moment变量。 d.ts文件中的其他接口定义,例如interface Moment ,将不会真实导出。 那些用于TypeScript编译器和intellisense的。 这就是为什么你遇到过上面的TS编译器和TypeError问题。 你可能会用autoinject欺骗编译器,但不是浏览器。 时刻的定义文件 : declare module 'moment' { var moment: moment.MomentStatic; export = m ...
  • 将命令更改为au run --watch 。 它应该默认使用dev环境运行,并且在运行没有--watch标志的应用程序时,在最近的一次Webpack更新之后,Webpack和Aurelia CLI存在一个已知问题。 编辑 另外,尝试安装Yarn的依赖关系, npm install目前似乎没有正确安装软件包,但yarn install似乎正常工作。 npm install yarn yarn install Change the command to au run --watch. It should run ...
  • 正如阿什利的回答中提到的那样,我的问题无法解决我想要的方式。 一些节点包仅用于服务器而不是浏览器... As it was mentioned in the answer of the Ashley, my problem is irresolvable the way I wanted. Some node packages are only made for servers and not browsers...
  • 尝试这个。 let client = new HttpClient() .configure(x => { x.withInterceptor({ request(request) { request.headers.append('User-Agent', 'myApp/0.1'); request.headers.append('Authorization', 'Discogs key=xxxxx, s ...
  • 我遇到了包含多个模块的相同错误。 您需要在aurelia.json配置依赖项部分,如Aurelia CLI文档[部分:将客户端库添加到项目 - CommonJS包]中所述 。 aurelia.json - build.bundles.dependencies ... other deps { "name": "firebase", "path": "../node_modules/firebase", "main": "firebase" }, ... other deps I ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。