Вот моя полезная нагрузка 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
Форум для тех, кто программирует под Android
1729494299
Anonymous
Вот моя полезная нагрузка 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 () => {
});
Подробнее здесь: [url]https://stackoverflow.com/questions/79108916/fcm-notification-in-android-custom-sound-banner-and-image-not-working-with-v1[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия