티스토리 뷰
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | <?php $token = "자신의기기토큰" ; $apnsPort = 2195; // dev $apnsHost = 'gateway.sandbox.push.apple.com' ; $apnsCert = 'apns-dev.pem' ; // production //$apnsHost = 'gateway.push.apple.com'; //$apnsCert = 'apns-production.pem'; $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 ); if ( $apns ) { $payload [ 'aps' ] = array ( 'alert' => 'Oh hai!' , 'badge' => 1, 'sound' => 'default' ); $output = json_encode( $payload ); $token = pack( 'H*' , str_replace ( ' ' , '' , $token )); $apnsMessage = chr (0) . chr (0) . chr (32) . $token . chr (0) . chr ( strlen ( $output )) . $output ; fwrite( $apns , $apnsMessage ); fclose( $apns ); } ?> |
'모바일 > iOS' 카테고리의 다른 글
XCode 4.x 이상에서 디버깅 셋팅과 추적 (0) | 2013.05.27 |
---|---|
APNS 푸시 서버 라이브러리 (0) | 2012.08.13 |
EasyAPNs 메세지 발송 소스 (0) | 2012.07.30 |
Easy APNs (PHP와 함께 iOS 푸시 알림 서비스 구축) (2) | 2012.07.17 |
iOS 아이폰 아이콘 크기 안내 (0) | 2012.05.07 |
댓글
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
- Make Use Of
- How to geek
- 인터넷 통계정보 검색시스템
- 트위터 공유 정보모음
- 웹표준KR
- 치우의 컴맹탈출구
- Dev. Cheat Sheets
- w3schools
- Dev. 조각들
- ASP Ajax Library
- CSS Tricks
- WebResourcesDepot
- jQuery Selectors Tester
- DeveloperSnippets
- Smashing Magazine
- Nettuts+
- devListing
- 웹 리소스 사이트(한)
- Mobile tuts+
- Dream In Code
- Developer Tutorials
- CSS3 Previews
- 자북
- 안드로이드 사이드
- Code Visually
- Code School
- SQLer.com
- 무료 파워포인트 템플릿
- iconPot
- Free PowerPoint Templates
- Design Bombs
- Web Designer Wall
- 1st Webdesigner
- Vandelay Design
- 무료 벡터 이미지 사이트들
- Tripwire Magazine
- Web TrendSet
- WebMonkey
- 윤춘근 프리젠테이션 디자이너 블로그
- cz.cc 무료 DNS
- [웹하드] MediaFire
- [웹하드] DivShare
- 한컴 인터넷 오피스
TAG
- JSON
- nodejs
- JQuery
- 워드프레스
- Debug
- 한글
- Mac
- mssql
- nginx
- Android
- Docker
- Prototype
- Wordpress
- classic asp
- laravel
- git
- javascript
- iphone
- ASP
- CSS
- IE
- Chrome
- IOS
- Linux
- API
- sencha touch
- 안드로이드
- centos
- PHP
- iis
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
글 보관함