我正在使用 Instagram 实时更新标签,当有人用特定标签标记媒体时收到通知。订阅工作正常,我可以使用 https://api.instagram.com/v1/subscriptions?client_secret= {cs}&client_id={cid}直接检查订阅
在回调中我有类似的东西
if (isset ($_GET['hub_challenge'])){
echo $_GET['hub_challenge'];
}
else{
$my_string = file_get_contents('php://input');
$sub_update = json_decode($my_string);
//do the rest of the things with data we fetched
}
}
但是,这个回调从 instagram 端执行了两次。例如,如果我订阅了“winter”标签,并且如果有人发布媒体并使用该标签对其进行标记,instagram 将向我在订阅期间指定的回调文件发送两次通知(两个调用都在几秒钟内执行)。为什么 Instagram 向回调发送两次请求?有人有类似的问题吗?