oney / TestGcm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TestGcm

  • git clone
  • npm install
  • Must run react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle
  • react-native run-android

Send GCM notification

curl -X POST -H "Authorization: key=AIzaSyAwix-QqbNZBN_LvFhJD3wZOPXKjmtayUo" -H "Content-Type: application/json" -d '
{
  "data": {
    "info": {
      "subject": "Hello GCM2",
      "message": "Hello from the server side!"
    }
  },
  "to" : "GCM_TOKEN"
}' 'https://gcm-http.googleapis.com/gcm/send'

After running this project, you can get gcm token and place GCM_TOKEN of above code. Run this curl command in terminal to test gcm notification.

About


Languages

Language:Objective-C 45.3%Language:JavaScript 32.2%Language:Java 22.5%