Rich notification not received when app is force quit

228 Views Asked by At

This problem is related to Appboy/Braze SDK. Atleast I hope so.

In case the app is terminated and a sample standard/simple push is sent I get the notification. However, rich notification doesn't appear at all.

This rich notification is implemented as push stories where there are more than one page and you can scroll through the notification.

When app is in foreground or background everything works fine.

Any ideas what could be the problem?

1

There are 1 best solutions below

0
On BEST ANSWER

The problem was with the APNS payload. The value of alert inside aps directory was empty string.

Also the log in the Console showed these two logs.

Received remote notification request [ hasAlertContent: 0, hasSound: 0 hasBadge: 0 hasContentAvailable: 1 hasMutableContent: 0 ]

Not delivering user visible notification because it has no alert, sound or badge

According to the documentation:

To support a background update notification, make sure that the payload’s aps dictionary includes the content-available key with a value of 1. If there are user-visible updates that go along with the background update, you can set the alert, sound, or badge keys in the aps dictionary, as appropriate.