I am trying to develop an iOS app using UrbanAirship. I receive push notifications but cannot get any delegate to be called when the app is in the background. I (wrongfully it seems) assumed that the handleBackgroundNotification API from the UAPushNotificationDelegate class would provide me the functionality to execute custom actions when receiving the notification when app is in the background.
This is what their documentation says: "handleBackgroundNotification:
Called when a push notification is received when the application is in the background
- (void)handleBackgroundNotification:(NSDictionary *)notification
Parameters
notification
the push notification
Doesn't seem to work that way - sure seems the OS is keeping the notification for itself - which is inline with Apple's documentation.
I am questioning the purpose of the function if the OS doesn't allow it. I use didReceiveRemoteNotification for receiving remote push notifications which works just fine!
However, since this is an enterprise application (i.e. not App Store), if there are private APÏs and frameworks that would allow me to do this, I would appreciate any assistance. There is no way this app would ever make it to the app store!
The custom actions I am trying to execute include, for example, a notification receipt sent to a server that would "prove" the recipient app did indeed receive the notification, play a custom sound at maximum volume (bypassing silence and do not disturb mode). These are some requirements from the client.