PHP | 안드로이드 푸쉬 push 보내기
페이지 정보
작성자 전소현 작성일20-12-30 09:33 조회455회 댓글0건관련링크
본문
function send_fcm($token, $title, $content, $url, $type) {
$param = http_build_query(array(
'token' => $token,
'title' => $title,
'content' => $content,
'url' => $url,
'type' => $type
));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:3000/');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $param);
curl_exec($ch);
curl_close($ch);
}
$arr['registration_ids'][0] = 'key' ;
$arr['registration_ids'][1] = 'key' ;
send_fcm($arr['registration_ids'][0], iconv('EUC-KR', 'UTF-8', $titleData), $messageData, $urlData, 0);
$param = http_build_query(array(
'token' => $token,
'title' => $title,
'content' => $content,
'url' => $url,
'type' => $type
));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:3000/');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $param);
curl_exec($ch);
curl_close($ch);
}
$arr['registration_ids'][0] = 'key' ;
$arr['registration_ids'][1] = 'key' ;
send_fcm($arr['registration_ids'][0], iconv('EUC-KR', 'UTF-8', $titleData), $messageData, $urlData, 0);
[주소복사] https://www.goodsweb.kr/?u=D41dGC7
SNS 알리기
핀터레스트
텔레그램로
블로그로
페이스북
트위터
카카오스토리
카톡 공유
관련 블로그
로딩중