【问题标题】:Firebase - Invalid path: Invalid token in pathFirebase - 路径无效:路径中的令牌无效
【发布时间】:2014-08-23 23:14:59
【问题描述】:

我正在使用这个 PHP 包 firebase-php 与 REST API 进行通信。

我想做非常基础的数据推送:

require_once ('utilities/firebase/firebaseLib.php');

$firebase = new Firebase(<my firebase url>, <my firebase token>);

$data = [
    'ip' => "123456789",
    'session' => "1234",
    'sequence' => "12",
    'time' => "159159159",
    'event' => "Pause",
    'data' => "1"
];

$res = $firebase->push(<my firbase path.json>, $data);

执行后我得到这个错误: { "error" : "Invalid path: Invalid token in path" }

不确定这个错误是什么意思,文档中没有解释...

将不胜感激!

【问题讨论】:

    标签: firebase


    【解决方案1】:

    push 方法中的 firebase 路径($res = $firebase-&gt;push(my-firebase.firebaseio.com/structure/of/json, $data); 应该是主 firebase url 的相对路径。

    所以应该是'structure/of/json' 而不是'my-firebase.firebaseio.com/structure/of/json'

    【讨论】:

      猜你喜欢
      • 2017-02-27
      • 2017-10-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-11
      • 2016-12-24
      • 1970-01-01
      • 2012-04-12
      相关资源
      最近更新 更多