update readme.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2016-10-23 22:01:08 +08:00
parent 81f37465b0
commit f42d9e2ee3
1 changed files with 49 additions and 48 deletions

View File

@ -364,7 +364,7 @@ See more example about [iOS](#ios-example) or [Android](#android-example).
Request body must has a notifications array. The following is a parameter table for each notification.
| name | type | description | required | note |
|-------|-------|--------|--------|---------|
|-------------------------|--------------|---------------------------------------------------------------------------------------------------|----------|---------------------------------------------------------------|
| tokens | string array | device tokens | o | |
| platform | int | platform(iOS,Android) | o | 1=iOS, 2=Android |
| message | string | message for notification | o | |
@ -373,6 +373,7 @@ Request body must has a notifications array. The following is a parameter table
| content_available | bool | data messages wake the app by default. | - | |
| sound | string | sound type | - | |
| data | string array | extensible partition | - | |
| retry | int | retry send notification if fail response from server. Value must be small than `max_retry` field. | - | |
| api_key | string | Android api key | - | only Android |
| to | string | The value must be a registration token, notification key, or topic. | - | only Android |
| collapse_key | string | a key for collapsing notifications | - | only Android |
@ -391,7 +392,7 @@ Request body must has a notifications array. The following is a parameter table
### iOS alert payload
| name | type | description | required | note |
|-------|-------|--------|--------|---------|
|----------------|------------------|--------------------------------------------------------------------------------------------------|----------|------|
| action | string | The label of the action button. This one is required for Safari Push Notifications. | - | |
| action-loc-key | string | If a string is specified, the system displays an alert that includes the Close and View buttons. | - | |
| launch-image | string | The filename of an image file in the app bundle, with or without the filename extension. | - | |
@ -405,7 +406,7 @@ See more detail about [APNs Remote Notification Payload](https://developer.apple
### Android notification payload
| name | type | description | required | note |
|-------|-------|--------|--------|---------|
|----------------|--------|-----------------------------------------------------------------------------------------------------------|----------|------|
| icon | string | Indicates notification icon. | - | |
| tag | string | Indicates whether each notification message results in a new entry on the notification center on Android. | - | |
| color | string | Indicates color of the icon, expressed in #rrggbb format | - | |
@ -519,7 +520,7 @@ Add other fields which user defined via `data` field.
Error response message table:
| status code | message |
|-------|-------|
|-------------|--------------------------------------------|
| 400 | Missing `notifications` field. |
| 400 | Notifications field is empty. |
| 400 | Number of notifications(50) over limit(10) |