Track remote push notifications when using the app in the background

I am using Urban Airship to handle remote push notifications for my iOS application. It works as expected, and I receive notifications both in the foreground and in the background. Nevertheless, I would like to monitor all incoming remote push notifications (even if they are not executed). Therefore, if a remote push arrives, I would like to call some code to record what the notification was. It seems that I can only cope when the user deletes the notification, and not when it is received. Is it possible?

I set the background for Remote Notifications, implemented both didReceiveRemoteNotification in appdelegate, and the resulting getBackgroundNotification method for the city airship. I also set backgroundPushNotificationsEnabled to yes.

Any ideas if possible?

Here is an example of a push notification:

{
    "_" = "Q-Pr3MeyLaEeS8csDiudL0-A";
    aps =     {
        alert = "A simple message";
        badge = 53;
    };
    id = ea591946c21d437f8fc1c851e1c1e728;
    pid = 6a26766232e14d971dc1417a0c217bfc;
    type = c1;
}
+4
source share

All Articles