Google Cloud messaging - Sample Server

后端 未结 4 733
清酒与你
清酒与你 2020-12-08 05:48

I need a sample application for Google Cloud messaging. with a sample server to test my app. can any one help me on this?

I need a sample server to test my code i al

相关标签:
4条回答
  • 2020-12-08 06:11

    "curl" command line tool can be used to send messages to devices registered with GCM.

    curl -X POST \
      -H "Authorization: key= <YOUR_AUTHORIZATION_KEY>" \
      -H "Content-Type: application/json" \
      -d '{
      "registration_ids": [
        "<YOUR_DEVICE_TOKEN>"
      ],
      "data": {
        "message": "<YOUR_MESSAGE>"
      }
    }' \
      https://android.googleapis.com/gcm/send
    

    Please refer to this blog post for further details. http://www.zinniakhan.com/2014/07/check-google-cloud-messaging-gcm-client.html.

    0 讨论(0)
  • 2020-12-08 06:13

    We have a sample client up on GitHub: https://github.com/indigorose/airbop-client (based on the GCM client sample), which works with our GCM-based service AirBop: http://www.airbop.com Which you can test with for free.

    0 讨论(0)
  • 2020-12-08 06:18

    You need to download via Android SDK. go to Window->Android SDK Manager. scroll down to extra and check "Google Cloud Messaging" and install.

    after completed, you may check at : android-sdk/extras/google/gcm/samples

    or you could try this (I've uploaded myself) : gcm

    for server side, check on this answer : https://stackoverflow.com/a/11253231/554740

    0 讨论(0)
  • 2020-12-08 06:33

    I found an open-source sender client for windows here: https://gcm.codeplex.com/

    • Device token can be found after you implement the GCM registration code and retrieve your registration ID via your client app (setup a breakpoint or print statement so that you are able to copy/paste this value, it's pretty long)
    • Auth key is found after you setup your project in Google's developer console

    screenshot

    0 讨论(0)
提交回复
热议问题