현재 전체 사용자에게 매일 푸쉬가 가게 만들어 놓았습니다.
사람이 적을때는 괜찮았는데 몇쳔명이 넘어가니까 하나둘 안 온다는 사람들이 생겨서
테스트 해봣는데... 어떤건 가고 어떤건 안가고 그러더라고요 (뭔가 특정 놈만 안가는???)
현재 php 소스는
public function sends($type, $msg, $ids) {
$headers = array(
'Content-Type:application/json',
''Authorization:key=키입력"
);
$arr = array();
$arr['data'] = array();
$arr['data']['type'] = toUTF8($type);
$arr['data']['msg'] = toUTF8($msg);
$arr['registration_ids'] = array();
$arr['registration_ids'] = $ids;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://android.googleapis.com/gcm/send');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS,json_encode($arr));
$response = curl_exec($ch);
curl_close($ch);
}
이렇게해서 배열로 1000개씩 모아서 쏴주고 있습니다.
DB에 푸쉬가 재대로 안갔을시에 플래그 줘서
다시 한번 쏘는거를 만들려는데 어떻게 재대로 갔는지 성공했는지 실패 했는지 알수 없을까요?
$response 보시면 json 형태로 결과리턴 받을겁니다.