-2
이 문서를 읽은 후 나는 다음과 같은 소스 작성 시도 :일정 urbanairship 푸시 알림
$contents = array();
//$contents['badge'] = "+1";
$contents['alert'] = "Touchdown!";
//$contents['sound'] = "cat.caf";
$notification = array();
$notification= $contents;
$audience['tag'] = "49ers";
$scheduled['scheduled_time'] = "2013-04-01T18:45:30";
$push['push'] = array("audience"=> $audience, "notification"=>$notification, "device_types"=>"all");
$response = array();
array_push($response, array("name" => "My schedule", "schedule"=> $scheduled));
array_push($response, $push);
$json = json_encode($response);
//echo "Payload: " . $json . "\n"; //show the payload
$session = curl_init(PUSHURL);
curl_setopt($session, CURLOPT_USERPWD, APPKEY . ':' . PUSHSECRET);
curl_setopt($session, CURLOPT_POST, True);
curl_setopt($session, CURLOPT_POSTFIELDS, $json);
curl_setopt($session, CURLOPT_HEADER, False);
curl_setopt($session, CURLOPT_RETURNTRANSFER, True);
curl_setopt($session, CURLOPT_HTTPHEADER, array('Content-Type:application/json', 'Accept: application/vnd.urbanairship+json; version=3;'));
$content = curl_exec($session);
// echo "Response: " . $content . "\n";
print_r($content);
// Check if any error occured
$response = curl_getinfo($session);
if($response['http_code'] != 202) {
$error = "Got negative response from server: " . $response['http_code'] . "\n";
} else {
$success = "Message has been sent successfully";
}
을 나는 오류 = 0 사람이 제발 도와 줄 수는 무엇입니까?
감사합니다.
.... 내가 예약 된 메시지가 미래를 계획 할 필요가 있으리라 믿고있어. – dperconti
답변 해 주셔서 감사합니다. 2016 년을 열 으려고했지만 여전히 작동하지 않습니다. 응답 코드에서 0을 얻습니다. –
Urban Flyship을 통해 정상적인 푸시 알림을받을 수 있습니까? – dperconti