Я получаю push-уведомления с данными, Когда я нахожусь в приложении, я получаю правильно, когда я убиваю приложение на переднем плане, я тоже получаю правильно, уведомление проходит через didReceiveRemoteNotification
, но когда приложение находится в фоновом режиме, оно проходит черезdidReceive
как локальное уведомление, почему так?
А если нет способа передать его через didReceiveRemoteNotification
, как я могу восстановить данные из didReceive
, когда приложение находится в фоновом режиме?
Вот отправленный JSON:
{
"data": {
"title": "Callisthenics Workout: Bodyweight Training You Can Do Anywhere",
"body": "Wherever you can swing your arms – whether that's in the park or at home",
"fulltxt": "Bodyweight training has exploded during the last year or two, with more apps and videos being developed to help programme your training and show you how to progress your movements. Not only is this callisthenics workout a great way to shape up your body, but being able to control your own body in all different planes of movement is crucial for it to function at its peak, and stay healthy day to day.I tend to stay away from the term, 'functional training', because anything be functional if it serves a direct purpose. ",
"author": "Simon Cushman",
"created_at": "1534755892",
"sheduled": "1542705780",
"article_id": "3",
"photo": "articles/NjXF9vIm3lZVa4VwZog1xbsJ4t7Pqk.jpg",
"brand": "2",
"fulltxt2": "The term is highly applicable here for most people, as functional training can build core strength and posture in a society that's been stuck to desk work and convenient travel for far too long. If you've ever seen someone try and do a handstand with poor posture and core, just doesn't work. So, here's a workout literally anybody can try out and either begin or progress on their way to the callisthenic glory.",
"type": "article"
},
"notification": {
"title": "Callisthenics Workout: Bodyweight Training You Can Do Anywhere",
"body": "Wherever you can swing your arms – whether that's in the park or at home"
}
}
Мои вопросы:
Почему в фоновом режиме push-уведомление проходит didReceive
вместо didReceiveRemoteNotification
?
Как нажать кнопку уведомления на didReceiveRemoteNotification
, когда приложение находится в фоновом режиме
И если естьнет решения, и что толчок принудительно передать didReceive
, то как читать данные?