Reputation: 1560
I'm carrating on an app that was written by a programmer before me. It has only 2 view controllers: the main one displaying chat (its the root view controller) and a second one to tinker with your profile. I was asked to implement some kind of notification (preferably one that pops up at the top of the screen) to the user that a message has arrived when they are inside that profile-tinkering view controller. Must I use the APNS server technique, or can I use an easier technique by utilizing the App Delegate somehow?
Upvotes: 0
Views: 58
Reputation: 2153
When you are inside another view, the APNS
wont get displayed because the application is already in foreground.
When app is in foreground and you receive an APNS
, didReceiveRemoteNotification
method will get called.
You can read APNS
package here and notify user of this in a way you want, for e.g. you can display an alert.
Upvotes: 1
Reputation: 63
APNS
, I prefer the local notification,didReceiveLocalnotification
method will get called,then display an alertUpvotes: 1