앱을 개발했습니다. 앱이 실행되지 않을 때 번 배지 업데이트를 제외한 모든 기능이 작동합니다..iOS : Badge가 업데이트를 거부합니다 (appcelerator)
푸시 알림을 받았지만 배지에는 아무런 변화가 없습니다.
Apple에 등록 할 때 응용 프로그램에서 경고 및 배지 유형을 요청합니다.
아이디어가 있으십니까? 이것은 나를 미치게 만든다.
<?php
$apnsHost = 'gateway.sandbox.push.apple.com';
$apnsCert = '/usr/local/php/cert.pem';
$apnsPort = 2195;
$streamContext = stream_context_create();
stream_context_set_option($streamContext, 'ssl', 'local_cert', $apnsCert);
$apns = stream_socket_client('ssl://' . $apnsHost . ':' . $apnsPort, $error, $errorString, 2, STREAM_CLIENT_CONNECT, $streamContext);
$payload['aps'] = array('alert' => 'Oh hai!', 'badge' => 1);
$output = json_encode($payload);
$token = '1234';
$token = pack('H*', str_replace(' ', '', $token));
$apnsMessage = chr(0) . chr(0) . chr(32) . $token . chr(0) . chr(strlen($output)) . $output;
fwrite($apns, $apnsMessage);
socket_close($apns);
fclose($apns);
모바일 측 코드를 표시 할 수 있습니까? –