1

我正在制作 Facebook 即时游戏,并通过相关的机器人向自己发送测试消息。

有用。但并非总是如此,为什么?

很多时候我得到这个:

{
    "error": {
        "message": "(#100) Cannot send Instant Game message to user at this time.",
        "type": "OAuthException",
        "code": 100,
        "error_subcode": 2018144,
        "fbtrace_id": "DNZhKZlP83D"
    }
}

此错误代码未在错误代码文档中列出。

我想这可能是一些消息发送限制,但我认为作为应用程序的上市开发者,我将不受任何限制。

更多细节以防万一

我已经订阅了 webhook,并创建了一个与我的即时游戏应用相关联的页面,并拥有它的访问令牌。我要发送消息的用户是我,列为开发人员。

当我收到 game_play 事件时,例如:

{
    "object": "page",
    "entry": [{
        "id": "189899011738553",
        "time": 1521899151513,
        "messaging": [{
            "recipient": {
                "id": "189899011738553"
            },
            "timestamp": 1521899151513,
            "sender": {
                "id": "1647209385355472"
            },
            "game_play": {
                "game_id": "176650212970169",
                "player_id": "1293384810761815"
            }
        }]
    }]
}

我找到了发件人 ID,并发送如下响应:

{
    "message": {
        "attachment": {
            "type": "template",
            "payload": {
                "template_type": "generic",
                "elements": [{
                    "buttons": [{
                        "type": "game_play",
                        "title": "Play"
                    }],
                    "title": "Hello World"
                }]
            }
        }
    },
    "recipient": {
        "id": "1647209385355472"
    }
}

这是卷曲版本:

curl -X POST \
  'https://graph.facebook.com/me/messages?access_token=MY_ACCESS_TOKEN' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{"message": {"attachment": {"type": "template", "payload": {"template_type": "generic", "elements": [{"buttons": [{"type": "game_play", "title": "HELLO"}], "title": "HELLO WORLD"}]}}}, "recipient": {"id": "1647209385355472"}}'

并且只是为了显示访问令牌是有效的,尽管出现了“OAuthException”,并且它有时确实有效:

在此处输入图像描述

在此处输入图像描述

4

1 回答 1

1

我们已确保此错误现已记录在案。

此消息表示向小游戏用户发送消息的消息数量或时间窗口超出了小游戏机器人策略。

这适用于开发人员和管理员以及应用程序的用户。玩游戏或与机器人通信应该重置这些限制。

于 2018-03-25T22:08:26.577 回答