2

I send my device the push notification "aps":{"content-available":1} but it doesn't launch the application in background.

But when I send the notification this method is called

-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{
    NSLog(@"%@", userInfo);
}

Logs:

{
    aps =     {
        "content-available" = 1;
    };
}

Is there any way to debug this ??

lsamayoa
  • 144
  • 4
  • I have the same problem, the app receives the push only when in foreground or background, not when fully closed. Does no one have an idea how to make the app receiving the push when not active? – Micky Oct 29 '12 at 11:17

1 Answers1

0

when the push notification arrives,

if your application is in the background, -(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo will be called.

if your application has been terminated, - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions will be called to launch your application in the background.

You can start your issue download accordingly.

NOTE: Make sure you have set up Newsstand requisites properly.

  1. Your "info.plist" has the following keys also

    UINewsstandApp UIBackgroundModes newsstand-content

  2. You have the following piece of code in your didFinishLaunchingWithOptions: method

[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NKDontThrottleNewsstandContentNotifications"];

This will ensure that the content-available:1 notification is received by the app every time iOS receives it in the development mode only. Usually only one such notification per app(newsstand app) per day is allowed when the app is in App Store.

Revanth
  • 113
  • 12