Chris
Chris

Reputation: 5627

Handling Push Notification While App is Open

I have my Push Notification running. It works. I receive a notification and use

application:didReceiveRemoteNotification: 

to get the incoming data and then send the user to the necessary screen.

Problem is, if you are using the App and a notification is received, it jumps to the destination screen without giving any alert/sound/anything.

I could put an alert in application:didReceiveRemoteNotification:, but then that alert would appear every time, not just when the app is running.

Ideas about how to handle this?

Upvotes: 8

Views: 4597

Answers (1)

raid5ive
raid5ive

Reputation: 6642

I would recommend checking the applicationState property in UIApplication to determine if the app is running in the background or not.

Upvotes: 5

Related Questions