4

I use Urban Airship to handle remote push notifications for my iOS app. It works as expected, and I get notifications both in foreground and in background. I would however like to track all incoming remote push notifications (even if they are not executed). So if a remote push arrives, I would like to invoke some code to record what kind of notification it was. I seem to only be able to handle when a user taps a notification, and not when it is received. Is this possible?

I have set Background mode to "Remote notifications", implemented both didReceiveRemoteNotification in appdelegate and a both receivedBackgroundNotification for urban airship. I have also set backgroundPushNotificationsEnabled to yes.

Any ideas if this is even 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;
}
pnit
  • 273
  • 1
  • 2
  • 7
  • I don't understand your question. Is receivedBackgroundNotification not being triggered upon receiving a background push? If so, please post your implementation of receivedBackgroundNotification. – Donato Perconti Mar 17 '15 at 17:04

0 Answers0