Xcode background application launch detection to debug Newsstand application

I am trying to stop the didFinishLaunchingWithOptions point in my app’s deletion in order to capture the app that is starting (in the background) when the newsstand problem download finishes after the app was interrupted. I believe that this can happen, for example, if the user manually requests a download, and then the application terminates.

On the information tab of the launch scheme in the Xcode scheme editor, you can wait for the application to start. The comment below says that it should be used when you want to start the application manually. Although this is not what I want, I tried it anyway, and it is not surprising that it does not look like what I want. Does anyone have a way to do this?

+1
source share
1 answer

Wait for your.app to launch can be used to delay the start of the debugger. Its very useful when testing newsstand updates arriving after simulating push notifications.

You can put a breakpoint in the application: didFinishLaunchingWithOptions: and then run your push notification, which will mimic a problem with the publication of a newspaper magazine.

Remember that if you are testing, you want you not to throttle newsstand updates. In production, you can only receive 1 time per day, so add this:

 #ifdef DEBUG // For debugging - allow multiple pushes per day [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NKDontThrottleNewsstandContentNotifications"]; [[NSUserDefaults standardUserDefaults] synchronize]; #endif 

Is this what you were looking for? If not, please specify.

+3
source

Source: https://habr.com/ru/post/1393109/


All Articles