Ребята, я пытаюсь получить заголовок и текст уведомления из push-уведомлений OneSignal. Я пытался получить данные из JSON, например HTTP, но это не сработало
OneSignal.shared
.setNotificationReceivedHandler((OSNotification notification) {
// will be called whenever a notification is received
print('Recived Notification is : $notification');
notification.convertToJsonString({'title': title, 'alert': body});
print('Title is : $title');
print('Description is : $body');
});
onesignal( 9471): Created json raw payload: {vis=1, google.original_priority=normal, google.sent_time=1566080374593, pri=5, grp_msg=, google.delivered_priority=normal, custom={"i":"cb91f929-3008-4364-a687-1675448c2d0a"}, oth_chnl=, title=Welcom test Notification, google.message_id=0:1566080374598190%ab53bc02f9fd7ecd, alert=this is description of welcome text content notification, google.ttl=259200, from=613584415888, notificationId=173367476}
I/flutter ( 9471): Recived Notification is : Instance of 'OSNotification'
I/flutter ( 9471): Title is : null
I/flutter ( 9471): Description is : null
Подробнее здесь: https://stackoverflow.com/questions/575 ... ns-flutter
Как извлечь заголовок сообщения и форму тела push-уведомлений OneSignal Flutter ⇐ Android
Форум для тех, кто программирует под Android
1726693709
Anonymous
Ребята, я пытаюсь получить заголовок и текст уведомления из push-уведомлений OneSignal. Я пытался получить данные из JSON, например HTTP, но это не сработало
OneSignal.shared
.setNotificationReceivedHandler((OSNotification notification) {
// will be called whenever a notification is received
print('Recived Notification is : $notification');
notification.convertToJsonString({'title': title, 'alert': body});
print('Title is : $title');
print('Description is : $body');
});
onesignal( 9471): Created json raw payload: {vis=1, google.original_priority=normal, google.sent_time=1566080374593, pri=5, grp_msg=, google.delivered_priority=normal, custom={"i":"cb91f929-3008-4364-a687-1675448c2d0a"}, oth_chnl=, title=Welcom test Notification, google.message_id=0:1566080374598190%ab53bc02f9fd7ecd, alert=this is description of welcome text content notification, google.ttl=259200, from=613584415888, notificationId=173367476}
I/flutter ( 9471): Recived Notification is : Instance of 'OSNotification'
I/flutter ( 9471): Title is : null
I/flutter ( 9471): Description is : null
Подробнее здесь: [url]https://stackoverflow.com/questions/57540349/how-to-extract-message-title-and-body-form-onesignal-push-notifications-flutter[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия