Skip to content

Commit

Permalink
docs: enhance notification handling for Android and iOS
Browse files Browse the repository at this point in the history
- Update section title to "Send Android or iOS notifications using Firebase Cloud Messaging"
- Add example for sending notification with custom sound on iOS devices, including JSON payload with sound settings

Signed-off-by: appleboy <appleboy.tw@gmail.com>
  • Loading branch information
appleboy committed Jun 23, 2024
1 parent 98399cd commit 9bb6305
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ A push notification micro server using [Gin](https://github.com/gin-gonic/gin) f
- [Send Android notification](#send-android-notification)
- [Send Huawei (HMS) notification](#send-huawei-hms-notification)
- [Send iOS notification](#send-ios-notification)
- [Send Android or iOS notifications using Firebase](#send-android-or-ios-notifications-using-firebase)
- [Send Android or iOS notifications using Firebase Cloud Messaging](#send-android-or-ios-notifications-using-firebase-cloud-messaging)
- [Run gorush web server](#run-gorush-web-server)
- [Web API](#web-api)
- [GET /api/stat/go](#get-apistatgo)
Expand Down Expand Up @@ -413,7 +413,7 @@ $ gorush -ios -m "your message" -i "your certificate path" \
-production
```

### Send Android or iOS notifications using Firebase
### Send Android or iOS notifications using Firebase Cloud Messaging

Send single notification with the following command:

Expand Down Expand Up @@ -607,6 +607,32 @@ Simple send notification on Android and iOS devices using Firebase, the `platfor
}
```

Send notification with custom sound on iOS devices, **volume must be in the interval [0, 1]**:

```json
{
"notifications": [
{
"tokens": ["token_a", "token_b"],
"title": "Hello World iOS!",
"message": "Hello World iOS!",
"platform": 2,
"apns": {
"payload": {
"aps": {
"sound": {
"name": "default",
"critical": 1,
"volume": 0.1
}
}
}
}
}
]
}
```

Send multiple notifications as below:

```json
Expand Down

0 comments on commit 9bb6305

Please sign in to comment.