shell에서 GCM 푸시 발송

shell에서 GCM 푸시 발송

푸시 테스트를 하다보면 자주 발송을 하면서 테스트를 해야하는데 별도의 앱을 개발하거나 서버 사이드의 개발이 필요하다.

간단히 쉘에서도 푸시를 발송 테스트를 할 수 있는데 아래와 같이 방법을 기술한다.

[형태]
curl --header "Authorization: key=[키값]" \--header Content-Type:"application/json" \https://gcm-http.googleapis.com/gcm/send \-d "[데이터]"

키값 : Api 키 값
데이터
    {
    "data": {
        "content": "데이터"
    },
    "to": "[Token]"
    }

[예제]
curl --header "Authorization: key=[Key]" \--header Content-Type:"application/json" \https://gcm-http.googleapis.com/gcm/send \-d "{\"data\":{\"content\":\"내용\"},\"to\":\"[Token]\"}"

댓글

이 블로그의 인기 게시물

ViewPager offscreenPageLimit 메모리 상태

ASP에서 C# 언어로 만든 DLL 호출

eskimo esim 사용기 - 일본 / 오사카(23/08/06 ~ 23/08/08)