我正在接收推送通知的iOS应用程序。我在AppDelegate中有以下代码当应用程序关闭时打印NSlog输出
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
if (application.applicationState == UIApplicationStateActive)
{
// app was already in the foreground
}
else
{
NSLog(@"Received push notification");
}
}
我正在Xcode中使用我的iPhone运行应用程序。当应用程序处于后台时,我可以在通知到达时看到NSLog。
当我关闭应用程序,即从iOS中打开的应用程序中删除它,Xcode中的调试器会话停止,并且即使在应用程序关闭时在我的iPhone上收到关于应用程序的通知后我也看不到NSlog即使关闭,通知也可以应用)
如何在关闭状态下打开应用程序时打印日志?
[如何关闭应用程序后的调试(HTTP的可能重复: //stackoverflow.com/questions/22782873/how-debug-after-closing-application) –