小编All*_*len的帖子

在Firebase实时数据库规则中验证匿名用户的显示名称

我正在为匿名用户设置显示名称,并希望确保新值与此设置的显示名称匹配.以下规则失败:

"name": { ".validate": "newData.val() == auth.token.name" }

为什么是这样?该文档说,显示名称存储在auth.token.name.

以下是我的firebase规则的完整副本:

{
    "rules": {
    ".read": false,
    ".write": false,
    "messages": {
        ".read": true,
        "$message": {
            ".write": "auth != null",
            ".validate": "newData.hasChildren(['createdAt', 'text', 'user'])",

            "createdAt": { ".validate": "newData.val() == now" },
            "text": { ".validate": "newData.isString() && newData.val().length > 0" },
            "user": {
                ".validate": "newData.hasChildren(['_id', 'name'])",
                 "_id": { ".validate": "newData.val() == auth.uid" },
                 "name": { ".validate": "newData.val() == auth.token.name" },
            "$other": { ".validate": false }
        },
        "$other": { ".validate": false …
Run Code Online (Sandbox Code Playgroud)

firebase firebase-security firebase-authentication firebase-realtime-database

7
推荐指数
1
解决办法
539
查看次数

Mirametrix S2注视跟踪器:发送通用输入(GPI)值始终失败

我正在使用Mirametrix S2凝视跟踪设备.在API文档(v1.1)中,它表示该ENABLE_SEND_GPI命令允许跟踪客户端将数据插入到注视流中.复制一些示例代码,我尝试了以下内容:

sock.send('<SET ID="ENABLE_SEND_GPI" STATE="1" />\r\n')
sock.send('<SET ID="GPI_NUMBER" VALUE="1" />\r\n')
sock.send('<SET ID="GPI1" VALUE="INTERVAL" />\r\n') 
Run Code Online (Sandbox Code Playgroud)

我得到以下回应:

<ACK ID="ENABLE_SEND_GPI" STATE="1" />
<ACK ID="GPI_NUMBER" VALUE="1" />
<ACK ID="GPI1" ERR="Invalid GPI ID" />
Run Code Online (Sandbox Code Playgroud)

我已经尝试了很多不同的ID组合,但是唯一获得响应的组合是GPI1通过GPI10,并且每个组合都被拒绝了Invalid GPI ID.我究竟做错了什么?

python xml eye-tracking

6
推荐指数
1
解决办法
152
查看次数

React Native文本输入更新非常慢

我有一个适用于iOS和Android的聊天应用程序 - 带有消息列表的基本布局和用于输入和发送消息的输入字段.几十条消息输入后输入速度非常慢.滚动列表仍然可以顺利运行.

我检查了iOS内存工具,它报告我没有内存泄漏.在Android systrace上,它显示deliverInputEvent超过300毫秒.

如何弄清楚deliverInputEvent需要这么长时间?

Android Systrace

performance android performance-testing ios react-native

5
推荐指数
1
解决办法
1798
查看次数

Getting "SSLPeerUnverifiedException" from Amazon SNS when using HTTPS endpoint

I'm having trouble getting Amazon SNS to send a subscription message to my HTTPS endpoint. The CloudWatch logs report the following:

{
    "delivery": {
        "deliveryId": "7bdda6a5-0000-5d6d-b0c0-e9b254fde521",
        "destination": "https://www.beta.yogacentre.com/webhooks/sns",
        "providerResponse": "SSLPeerUnverifiedException in HttpClient",
        "dwellTimeMs": 63661,
        "attempts": 4
    },
    "status": "FAILURE"
}
Run Code Online (Sandbox Code Playgroud)

It looks like it doesn't like the SSL certificate I'm using, but I confirmed that the root CA is on the list SNS checks. Chrome reports my connection uses TLS 1.2, so it should be compatible with the recent end …

ssl https amazon-web-services amazon-sns tls1.2

2
推荐指数
1
解决办法
632
查看次数