No, you do not need to enable background session collection to capture push notification data in Embrace. However, we recommend it.
If background session collection is not enabled, only push notifications received when the app is in the foreground will be captured by Embrace.
iOS does not notify the app of receiving a push notification unless the user interacts with it. This critical detail makes it essential to enable background session collection to get comprehensive data.
For example, for iOS only:
- If the app runs in the background and receives a push notification (PN), it will only be aware of the push IF the user interacts. Therefore a PN will not be logged in Embrace unless the user taps on it, even if background activity is enabled.
Notifications arriving with the app in the foreground will be received and can be logged/sent.
- If the user does not interact with the PN, the app is unaware of it regardless of the background tracking status. The PN is therefore, not logged or sent.
If the user interacts with the notification:
- With background session collection disabled, the notification is captured but cannot be saved since there’s no background session.
- With background tracking enabled, the notification is saved and sent with the session.
For Android only:
- If a PN arrives when the app is in the background and background activity is disabled, the PN doesn’t get sent to the server but lives on the cellphone memory.
- If a PN arrives during foreground activity with background activity disabled, the PN is not discarded and gets included in the session.
Please look at the following documentation to enable the automatic capture of push notification data for Android and iOS.
To enable background session capture, you can use the Settings page of the Embrace dashboard. Please note that this does increase the number of sessions captured by Embrace.