Вот моя полезная нагрузка fcm, я не могу получить собственный звук, белое изображение и отсутствие баннера. Может кто-нибудь сказать мне, что я делаю неправильно, я использую звук из res/drawable и res/raw. Он просто дает мне звук по умолчанию с правильным заголовком и телом.
payload = {
"message": {
"token": device_token_obj.token,
"notification": {
"title": "App Name",
"body": f"{***} from {***} has sent you a message!",
},
"data": {
"type": "new_message",
"*_id": str(***),
"id": str(***),
},
# APNs-specific configurations for iOS
"apns": {
"headers": {
"apns-priority": "10", # High priority
},
"payload": {
"aps": {
"alert": {
"title": "App Name",
"body": f"{***} from {***} has sent you a message!",
},
"sound": "default", # Play the default sound
"badge": 1, # Update the app icon badge count
"content-available": 1 # Enable background processing for silent notifications
}
}
},
"android": {
"priority": "high", # Set priority at the correct level
"notification": {
"icon": "ic_notification_icon", # Local icon name (without extension) in res/drawable
"sound": "notification_sound", # Ensure this matches the file name in res/raw
"title": "App Name ", # Add a title for Android-specific notification
"body": f"{***} from {***} has sent you a message!" # Add a body for Android-specific notification
}
}
}
}
Я слушаю здесь, в React Native, позже я понял, что Notifee не может мне помочь с этой проблемой.
import messaging from '@react-native-firebase/messaging';
messaging().setBackgroundMessageHandler(async () => {
});
Подробнее здесь: https://stackoverflow.com/questions/791 ... ng-with-v1
Уведомление FCM в Android: собственный звук, баннер и изображение не работают с API V1 ⇐ Android
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение