`priority` 参数对 GCM 消息有什么作用?

What does the `priority` parameter do to GCM Messages?

Google 最近在他们的 documentation of GCM 中引入了参数 priority。文档内容如下:

Sets the priority of the message. Use values between 0 - 10, where the higher value represents higher priority.

但是这个优先级到底是什么意思?不同的值 0 - 10 表示什么?

过了一会儿我找到了答案:priority 是 iOS 通知中使用的参数(如 the newly added content_available parameter)。

priority 的文档隐藏得很好,但可以在 The Binary Interface and Notification Format、"items and their identifiers" 的 table 中找到:

The notification’s priority. Provide one of the following values:

  • 10 The push message is sent immediately. The remote notification must trigger an alert, sound, or badge on the device. It is an error to use this priority for a push that contains only the content-available key.
  • 5 The push message is sent at a time that conserves power on the device receiving it.