rajeeb
rajeeb

Reputation: 151

iOS Push Notification Shows up as UIAlert when App is Running

I have push notifications successfully set up on my app. When I send a push to a user when they are not running the app they receive it banner-style as they should.

However, when a user has the app open, instead of displaying the push notification as a banner it shows up as a UIAlert. Receiving pushes only behaves this way when the app is open.

I have the "Alert Style When Unlocked" set up as "Banner" (on both phones), and this behavior persists.

Upvotes: 0

Views: 751

Answers (2)

Anurag Kondeya
Anurag Kondeya

Reputation: 57

The settings is for App in background, show as Banner or Alert. When App is opened it calls didReceiveRemoteNotification directly, and no Banner or Alert show up.

Upvotes: 0

Prashant Vashisht
Prashant Vashisht

Reputation: 183

When Applicationn is running you will get call in didReceiveRemoteNotification method on AppDelegate Class , so now you can handle notification here :

Now You can create a custom view and add it to your application main window as a banner.

Upvotes: 3

Related Questions