React Native AppCenter Push - 应用程序在后台时的通知
React Native AppCenter Push - Notifications when app is in background
我正在使用 React Native Microsoft AppCenter
,它将 Firebase Cloud Messaging
用于 Android 应用。
- 我在应用 打开、
时收到推送通知
- 当应用程序处于 后台 时,通知仅出现在系统托盘中,但不会实际出现
Notification
。
我必须打开托盘才能看到通知。任何帮助将不胜感激
所以我最后确实找到了答案。以防万一这是其他人绊倒的事情...
您需要将 'sound' 键和 'default' 值添加到自定义数据。
"notification_content": {
"name": "Some Name",
"title": "Some Title",
"body": "Some...body",
"custom_data": { "sound": "default" }
},
"notification_target": {
"type": "devices_target",
"devices": ["Some device ID"]
}
我正在使用 React Native Microsoft AppCenter
,它将 Firebase Cloud Messaging
用于 Android 应用。
- 我在应用 打开、 时收到推送通知
- 当应用程序处于 后台 时,通知仅出现在系统托盘中,但不会实际出现
Notification
。
我必须打开托盘才能看到通知。任何帮助将不胜感激
所以我最后确实找到了答案。以防万一这是其他人绊倒的事情...
您需要将 'sound' 键和 'default' 值添加到自定义数据。
"notification_content": {
"name": "Some Name",
"title": "Some Title",
"body": "Some...body",
"custom_data": { "sound": "default" }
},
"notification_target": {
"type": "devices_target",
"devices": ["Some device ID"]
}