How do I handle an APN message published to an app that's currently running an foreground?

A PubNub APN message received on an iOS device that's currently running the app in the foreground, calls the didReceiveRemoteNotification method, which can be used to trap the push notification. In other words, it can prevent it from showing on the device.

Please see how this is implemented in the APN sample app on our github repo for our iOS SDK. The only difference is that you would not display the message using the [alertView show] - just comment or remove that line of code.