rideintothesun
rideintothesun

Reputation: 1678

How to get a notification like the mail app on iOS

My understanding is that both local and remote notification in iOS will not be displayed if the application is in the foreground.

However if I open the mail app on my iPhone and check my email, then on some occasions i get a banner shown to tell me I have received emails. This occurs when the email app is in the foreground.

Does anyone know how this is done (preferably on Swift)? Or is this privilege only available for Apple written applications.

Any help would be appreciated.

Upvotes: 0

Views: 534

Answers (1)

Mert Buran
Mert Buran

Reputation: 3017

You should implement - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo method in your AppDelegate.

If you want to handle them by inflating views or whathaveyou, you need to do it in that particular method.

Upvotes: 1

Related Questions