본문 바로가기

스마트폰 프로그래밍/안드로이드4

Android GCM 활용해서 푸시 메세지 전송기 GCM의 특징GCM의 특징은 아래와 같다. Android 애플리케이션에 메시지를 보낼 수있는 3'rd Party 애플리케이션 서버를 허용한다.GCM은 메시지의 전달과 순서를 보장하지 않는다.메시지를 수신하기 위해 Android 디바이스의 Android 애플리케이션이 실행되고 있을 필요는 없다. 애플리케이션이 적절한 broadcast receiver와 권한을 설정하는 경우, 메시지가 도착했을 때, 시스템은 Intent broadcast가 Android 앱을 깨운다.메시지 데이터를 위해 내장 사용자 인터페이스 및 기타 다른 처리는 제공하지 않고 있다. GCM은 단순히 원시 메시지 데이터를 그대로 Android 앱에 전달하고, 메시지의 처리는 앱이 완벽하게 제어 할 수 있다. 예를 들어 애플리케이션은 노티를 .. 2013. 4. 24.
Google Cloud Messaging for Android Google Cloud Messaging for AndroidGoogle Cloud Messaging for Android (GCM) is a service that allows you to send data from your server to your users' Android-powered device. This could be a lightweight message telling your app there is new data to be fetched from the server (for instance, a movie uploaded by a friend), or it could be a message containing up to 4kb of payload data (so apps like in.. 2013. 4. 24.
PHP로 GCM 메시지 보내기 아래 코드를 보라 무척 쉽다. $headers = array( 'Content-Type:application/json', 'Authorization:key=AIzaSyCzMhR0yAL5RrZwMDaNnQaOq1w9mbTJDBg'); $arr = array();$arr['data'] = array();$arr['data']['msg'] = "gcm으로 보낼 메시지를 쓰면 된다."; $arr['registration_ids'] = array();$arr['registration_ids'][0] = "디바이스에서 얻어낸 아이디"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://android.googleapis.com/gcm/send');curl_seto.. 2013. 4. 24.
C2DM(Push Notification) 구현하기 - 서버(PHP) 편 예제 http://unikys.tistory.com/223 2013. 4. 24.