user2102502
user2102502

Reputation: 417

Why silent push notification not work properly in background in iphone sdk

I am using silent push notification in iOS app but not work properly in background while it work fine in foreground. I am unable to find out the what is the problem behind it. Please help me

Upvotes: 1

Views: 443

Answers (1)

Ganesh Somani
Ganesh Somani

Reputation: 2360

You should enable background mode for your app. As per iOS developer Library.

To support silent remote notifications, add the remote-notification value to the UIBackgroundModes array in your Info.plist file.

Also I believe that silent notifications work in background state. But that is only for UIApplicationStateBackground but after some time the app goes into suspended state and silent notifications wont work here. Needless to say it wont work when app is in terminated state

Supported states for silent push notifications would be UIApplicationStateActive,UIApplicationStateInactive, UIApplicationStateBackground. But this is something I have heard from a friend who has actually worked on it.

Hope it helps you. Good Luck

Upvotes: 2

Related Questions