谷歌push推送的curl方式 方便大家测试

gcm的curl, 需要修改$access_token$device_token

curl -X POST -H "Authorization: Bearer $access_token" -H "Content-Type: application/json" -d '{
"message":{
  "notification": {
    "title": "FCM Message",
    "body": "This is an FCM Message",
  },
  "token": "$device_token"
  }
}' "https://fcm.googleapis.com/v1/projects/myproject-b5ae1/messages:send"

fcm的curl, 需要修改$access_token$device_token

curl -XPOST -H "Authorization: key=$access_token" -H "Content-Type: application/json" -d '{ 
"priority": "high", 
"data": { 
"message": "data Message from wangxf" 
},
"to": "$device_token" 
}' https://fcm.googleapis.com/fcm/send

你可能感兴趣的:(push)