Facebook 即时游戏机器人消息经常导致 "Cannot send Instant Game message to user at this time"

Facebook Instant game bot message often results in "Cannot send Instant Game message to user at this time"

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

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

我经常得到这个:

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

此错误代码未在 error code documentation 中列出。

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

更多细节以防它们相关

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

当我收到 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 版本:

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" 只是为了表明访问令牌是有效的,而且它有时确实有效:

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

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

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