我正在使用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
}
Run Code Online (Sandbox Code Playgroud)
}
但是,这个回调是从Instagram方执行两次.因此,例如,如果我订阅"winter"标签,并且如果有人发布媒体并使用该标签对其进行标记,则instagram将向订阅期间指定的回调文件发送两次通知(两次调用都在几秒内执行).为什么Instagram会向回调发送两次请求?有谁有类似的问题?