未运行,点通知中心启动APP
didFinishLaunchingWithOptions(参数有内容,可以不管。因为会进入didReceiveNotificationResponse)-》didReceiveNotificationResponse
点app图标,啥也不会有。
运行在后台,点通知中心启动APP
didReceiveNotificationResponse
点app图标,啥也不会有。
运行在前台,
收到通知--马上进入到willPresentNotification
点击通知中心,-》didReceiveNotificationResponse
调试记录:
// 普通消息
2017-09-19 17:18:19.146527+0800 XXX[2085:447214] -[AppDelegate userNotificationCenter:willPresentNotification:withCompletionHandler:] ----------> {
UNNotificationRequest = {
UNNotificationContent = {
UNNotificationAttachment = (
);
badge = 0;
body = "\U662f\U7684\U963f\U65af\U987f\U53d1\U8212\U670d2";
categoryIdentifier = "";
launchImageName = "";
subtitle = "";
threadIdentifier = "";
title = "";
userInfo = {
aps = {
alert = {
body = "\U662f\U7684\U963f\U65af\U987f\U53d1\U8212\U670d2";
subtitle = "";
title = "";
};
sound = default;
};
d = us96166150581269377811;
p = 0;
};
};
identifier = us96166150581269377811;
};
date = "2017-09-19 17:18:18";
}
2017-09-19 17:19:48.571306+0800 XXX[2085:447214] -[AppDelegate userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:] ----------> {
UNNotificationResponse = {
UNNotificationRequest = {
UNNotificationContent = {
UNNotificationAttachment = (
);
badge = 0;
body = "\U662f\U7684\U963f\U65af\U987f\U53d1\U8212\U670d2";
categoryIdentifier = "";
launchImageName = "";
subtitle = "";
threadIdentifier = "";
title = "";
userInfo = {
aps = {
alert = {
body = "\U662f\U7684\U963f\U65af\U987f\U53d1\U8212\U670d2";
subtitle = "";
title = "";
};
sound = default;
};
d = us96166150581269377811;
p = 0;
};
};
identifier = us96166150581269377811;
};
date = "2017-09-19 17:18:18";
};
actionIdentifier = "com.apple.UNNotificationDefaultActionIdentifier";
}
// 自定义字段
2017-09-19 17:23:51.013074+0800 XXX[2085:447214] -[AppDelegate userNotificationCenter:willPresentNotification:withCompletionHandler:] ----------> {
UNNotificationRequest = {
UNNotificationContent = {
UNNotificationAttachment = (
);
badge = 0;
body = "\U662f\U7684\U963f\U65af\U987f\U53d1\U8212\U670d3";
categoryIdentifier = "";
launchImageName = "";
subtitle = "";
threadIdentifier = "";
title = "";
userInfo = {
aps = {
alert = {
body = "\U662f\U7684\U963f\U65af\U987f\U53d1\U8212\U670d3";
subtitle = "";
title = "";
};
sound = default;
};
bussinessLine = common;
d = us66157150581302741311;
p = 0;
};
};
identifier = us66157150581302741311;
};
date = "2017-09-19 17:23:49";
}
2017-09-19 17:23:54.104388+0800 XXX[2085:447214] -[AppDelegate userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:] ----------> {
UNNotificationResponse = {
UNNotificationRequest = {
UNNotificationContent = {
UNNotificationAttachment = (
);
badge = 0;
body = "\U662f\U7684\U963f\U65af\U987f\U53d1\U8212\U670d3";
categoryIdentifier = "";
launchImageName = "";
subtitle = "";
threadIdentifier = "";
title = "";
userInfo = {
aps = {
alert = {
body = "\U662f\U7684\U963f\U65af\U987f\U53d1\U8212\U670d3";
subtitle = "";
title = "";
};
sound = default;
};
bussinessLine = common;
d = us66157150581302741311;
p = 0;
};
};
identifier = us66157150581302741311;
};
date = "2017-09-19 17:23:49";
};
actionIdentifier = "com.apple.UNNotificationDefaultActionIdentifier";
}
// 内容链接
2017-09-19 17:26:05.435575+0800 XXX[2085:447214] -[AppDelegate userNotificationCenter:willPresentNotification:withCompletionHandler:] ----------> {
UNNotificationRequest = {
UNNotificationContent = {
UNNotificationAttachment = (
);
badge = 0;
body = "\U662f\U7684\U963f\U65af\U987f\U53d1\U8212\U670d3";
categoryIdentifier = "";
launchImageName = "";
subtitle = "";
threadIdentifier = "";
title = "";
userInfo = {
aps = {
alert = {
body = "\U662f\U7684\U963f\U65af\U987f\U53d1\U8212\U670d3";
subtitle = "";
title = "";
};
bussinessLine = common;
"mutable-content" = 1;
sound = default;
};
bussinessLine = common;
d = us61490150581316196211;
p = 0;
};
};
identifier = us61490150581316196211;
};
date = "2017-09-19 17:26:03";
}
2017-09-19 17:26:32.002471+0800 XXX[2085:447214] -[AppDelegate userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:] ----------> {
UNNotificationResponse = {
UNNotificationRequest = {
UNNotificationContent = {
UNNotificationAttachment = (
);
badge = 0;
body = "\U662f\U7684\U963f\U65af\U987f\U53d1\U8212\U670d3";
categoryIdentifier = "";
launchImageName = "";
subtitle = "";
threadIdentifier = "";
title = "";
userInfo = {
aps = {
alert = {
body = "\U662f\U7684\U963f\U65af\U987f\U53d1\U8212\U670d3";
subtitle = "";
title = "";
};
bussinessLine = common;
"mutable-content" = 1;
sound = default;
};
bussinessLine = common;
d = us61490150581316196211;
p = 0;
};
};
identifier = us61490150581316196211;
};
date = "2017-09-19 17:26:03";
};
actionIdentifier = "com.apple.UNNotificationDefaultActionIdentifier";
}
2017/09/19 17:41:06:210 -[AppDelegate application:didFinishLaunchingWithOptions:]----> {
"UIApplicationLaunchOptionsRemoteNotificationKey" : {
"d" : "us94553150581405739511",
"p" : 0,
"custom_bussinessLine" : "custom_common",
"aps" : {
"mutable-content" : 1,
"alert" : {
"title" : "",
"subtitle" : "",
"body" : "是的阿斯顿发舒服1001"
},
"bussinessLine" : "common",
"sound" : "default"
}
}
}