{"id":497398,"date":"2026-10-05T12:13:41","date_gmt":"2026-10-05T12:13:41","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=497398"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2026-10-05T12:13:41","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=497398","title":{"rendered":"Rich Push Notifications \u0432\u00a0iOS: Notification Service Extension, Notification Content Extension \u0438 \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440<\/h2>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u0430 \u043d\u0430\u00a0iOS\u2011\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441\u00a0\u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u043f\u0443\u0448\u2011\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0438 \u0445\u043e\u0442\u044f\u0442 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441\u00a0Notification Service Extension \u0438 Notification Content Extension. \u0417\u0434\u0435\u0441\u044c \u043d\u0435\u00a0\u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0443\u0448\u0435\u0439 \u0441\u00a0\u043d\u0443\u043b\u044f\u00a0\u2014 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u043e\u043a\u0443\u0441 \u0441\u0434\u0435\u043b\u0430\u043d \u043d\u0430\u00a0\u0440\u0430\u0431\u043e\u0442\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 payload, \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u0445 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439, \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u043c UI \u0438 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u043f\u0440\u0438\u00a0\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435. \u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0430\u00a0\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0434\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u044b \u043d\u0430\u00a0\u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u0445. \u0426\u0435\u043b\u044c \u0441\u0442\u0430\u0442\u044c\u0438\u00a0\u2014 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u00a0\u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0434\u0435\u0442\u0430\u043b\u0438, \u043d\u0430\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0438\u00a0\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 rich notifications.<\/p>\n<h2>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0430\u0437\u0431\u043e\u0440 \u043d\u0430\u00a0\u0434\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/h2>\n<p>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043f\u0443\u0448\u2011\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043d\u0435\u00a0\u0432\u0441\u0435\u0433\u0434\u0430. \u0418\u043d\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u00a0\u043f\u043e\u043a\u0430\u0437\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0434\u043b\u044f\u00a0\u0440\u0430\u0441\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0438\u043b\u0438\u00a0\u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c <code>UIViewController<\/code>. \u0422\u0430\u043a\u0438\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0435\u0449\u0451 \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c Rich Push Notifications. \u0412\u00a0\u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c, \u043a\u0430\u043a\u00a0\u0434\u043b\u044f\u00a0\u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Notification Service Extension \u0438 Notification Content Extension, \u043a\u0430\u043a\u00a0\u0441\u0432\u044f\u0437\u0430\u0442\u044c \u0438\u0445 \u0447\u0435\u0440\u0435\u0437 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u043f\u0443\u0448\u2011\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0438 <code>Info.plist<\/code>, \u0438 \u043a\u0430\u043a\u00a0\u043e\u0434\u043d\u0438\u043c Notification Content Extension \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439.<\/p>\n<h2>\u0414\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442<\/h2>\n<p>\u0412 <a href=\"https:\/\/github.com\/nerzul88\/PushNotificationsSample\" rel=\"noopener nofollow\">\u0434\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/a> \u0435\u0441\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0442\u0430\u0440\u0433\u0435\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0434\u0432\u0430 \u0442\u0430\u0440\u0433\u0435\u0442\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439:<\/p>\n<ul>\n<li>\n<p>NotificationsServiceExtension\u00a0\u2014 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u043f\u0443\u0448\u2011\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434 \u043f\u043e\u043a\u0430\u0437\u043e\u043c, \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u0445 \u0432 <code>UNNotificationAttachment<\/code>.<\/p>\n<\/li>\n<li>\n<p>NotificationsContentExtension\u00a0\u2014 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 UI \u0434\u043b\u044f\u00a0\u0434\u0432\u0443\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u00a0\u2014 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430\u00a0\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f, \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f\u00a0\u043f\u0443\u0448\u2011\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 <code>UNNotificationCategory<\/code>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435\u00a0\u0437\u0430\u0432\u0438\u0441\u0435\u043b \u043e\u0442\u00a0\u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0431\u044d\u043a\u0435\u043d\u0434\u0430 \u0438\u043b\u0438\u00a0\u043f\u0443\u0448\u2011\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430, payload \u0438 \u0432\u0441\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0432\u00a0\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435.<\/p>\n<h2>Service Extension \u0438 Content Extension\u00a0\u2014 \u043d\u0435\u00a0\u043e\u0434\u043d\u043e \u0438 \u0442\u043e\u00a0\u0436\u0435<\/h2>\n<p>\u0414\u043b\u044f\u00a0\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u043d\u043e\u0439 \u0442\u0435\u043e\u0440\u0438\u0438 \u043e\u00a0\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u0445. \u0418\u0445 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0445\u043e\u0436\u0438, \u043d\u043e\u00a0\u0441\u0430\u043c\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0430\u00a0\u0440\u0430\u0437\u043d\u044b\u0445 \u044d\u0442\u0430\u043f\u0430\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f. Notification Service Extension \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u0435\u0433\u043e \u043f\u043e\u043a\u0430\u0437\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u0432\u00a0\u0432\u0438\u0434\u0435 <code>attachments<\/code>. Notification Content Extension \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430\u00a0\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c.<\/p>\n<p>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u043f\u0440\u0438\u00a0\u0440\u0430\u0437\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445: Service Extension\u00a0\u2014 \u043f\u0440\u0438\u00a0\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441\u00a0<code>mutable-content<\/code>, \u0430\u00a0Content Extension\u00a0\u2014 \u0434\u043b\u044f\u00a0\u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0432 <code>Info.plist<\/code> \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0447\u0435\u0440\u0435\u0437\u00a0<code>category<\/code>. \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u043d\u0438 \u0432\u00a0\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u0445, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438 \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c \u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e.<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/783\/368\/35f\/78336835f46b4653a045d607f01baab0.png\" alt=\"\u041e\u0431\u043b\u0430\u0441\u0442\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f Notification Service Extension \u0438 Notification Content Extension\" title=\"\u041e\u0431\u043b\u0430\u0441\u0442\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f Notification Service Extension \u0438 Notification Content Extension\" width=\"1802\" height=\"873\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/783\/368\/35f\/78336835f46b4653a045d607f01baab0.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/783\/368\/35f\/78336835f46b4653a045d607f01baab0.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041e\u0431\u043b\u0430\u0441\u0442\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f Notification Service Extension \u0438 Notification Content Extension<\/figcaption><\/div>\n<\/figure>\n<p>\u0415\u0441\u0442\u044c \u0438 \u0435\u0449\u0451 \u043e\u0434\u043d\u043e \u0432\u0430\u0436\u043d\u043e\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0435: Notification Service Extension \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f\u00a0\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u043e\u043b\u044c\u043a\u043e remote notifications, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a\u00a0Notification Content Extension \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a\u0430\u043a\u00a0\u0434\u043b\u044f\u00a0remote, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f\u00a0local notifications.<\/p>\n<h2>1. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435: \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438<\/h2>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u043d\u0435\u00a0\u0441\u00a0\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439, \u0430\u00a0\u0441\u00a0\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412\u00a0\u0434\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u0432\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438:<\/p>\n<ul>\n<li>\n<p><code>pushWithImageCategory<\/code><\/p>\n<\/li>\n<li>\n<p><code>eventCategory<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f\u00a0\u043f\u0443\u0448\u2011\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441\u00a0\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c. \u0412\u0442\u043e\u0440\u0430\u044f\u00a0\u2014 \u0434\u043b\u044f\u00a0\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043e\u00a0\u0441\u043e\u0431\u044b\u0442\u0438\u0438 \u0441\u00a0\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u043c \u043b\u0435\u0439\u0430\u0443\u0442\u043e\u043c.<\/p>\n<pre><code class=\"swift\">private enum Category {    static let image = \"pushWithImageCategory\"    static let event = \"eventCategory\"}private func registerNotificationCategories() {    let imageCategory = UNNotificationCategory(        identifier: Category.image,        actions: [],        intentIdentifiers: [],        options: []    )    let eventCategory = UNNotificationCategory(        identifier: Category.event,        actions: [],        intentIdentifiers: [],        options: []    )    UNUserNotificationCenter.current().setNotificationCategories([        imageCategory,        eventCategory    ])}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper\"><\/span><\/a><\/div><\/pre>\n<p>\u042d\u0442\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b\u00a0\u2014 \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0438 payload. \u0414\u043b\u044f\u00a0\u043f\u0443\u0448\u2011\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430 <code>category<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 <code>aps<\/code> \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u0432\u043f\u0430\u0441\u0442\u044c \u0441 <code>identifier<\/code> \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438.<\/p>\n<h2>2. Payload: \u0433\u0434\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u0430 \u043b\u0435\u0436\u0430\u0442\u044c \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f<\/h2>\n<p>\u041e\u0434\u043d\u0430 \u0438\u0437\u00a0\u0441\u0430\u043c\u044b\u0445 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a\u00a0\u2014 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c category \u00ab\u043f\u043e\u0447\u0442\u0438 \u0442\u0443\u0434\u0430\u00bb. \u0414\u043b\u044f\u00a0APNs \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e: \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>category<\/code> \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u043b\u043e\u0432\u0430\u0440\u044f <code>aps<\/code>.<\/p>\n<p>\u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e:<\/p>\n<pre><code class=\"json\">{  \"aps\": {    \"alert\": {      \"title\": \"New photo\",      \"body\": \"Expand the notification to see the image\"    },    \"sound\": \"default\",    \"mutable-content\": 1,    \"category\": \"pushWithImageCategory\"  },  \"smallImageURL\": \"https:\/\/example.com\/preview.jpg\",  \"bigImageURL\": \"https:\/\/example.com\/content.jpg\"}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e:<\/p>\n<pre><code class=\"json\">{  \"aps\": {    \"alert\": {      \"title\": \"New photo\",      \"body\": \"Expand the notification to see the image\"    }  },  \"category\": \"pushWithImageCategory\"}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0412\u043e\u00a0\u0432\u0442\u043e\u0440\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 <code>category<\/code> \u0443\u0436\u0435 \u043d\u0435\u00a0\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c \u043a\u043b\u044e\u0447\u043e\u043c <code>aps<\/code>. \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f. \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0435\u0433\u043e \u043a\u0430\u043a <code>category<\/code> \u0434\u043b\u044f\u00a0\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0438 \u043d\u0430\u00a0URL \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439\u00a0\u2014 <code>smallImageURL<\/code> \u0438 <code>bigImageURL<\/code>, \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0440\u044f\u0434\u043e\u043c \u0441 <code>aps<\/code>, \u0430\u00a0\u043d\u0435\u00a0\u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e.<\/p>\n<h2>3. Mutable\u2011content: \u043a\u0430\u043a\u00a0\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Notification Service Extension<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b iOS \u043f\u0435\u0440\u0435\u0434 \u043f\u043e\u043a\u0430\u0437\u043e\u043c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0430 \u0435\u0433\u043e \u0432\u00a0Notification Service Extension, payload \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c <code>alert<\/code> \u0438 \u0444\u043b\u0430\u0433 <code>mutable-content<\/code> \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c <code>1<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 <code>aps<\/code>:<\/p>\n<pre><code class=\"json\">\"mutable-content\": 1<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c <code>didReceive(_:withContentHandler:)<\/code>, \u0433\u0434\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u043e\u043f\u0438\u044e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430, \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c \u0435\u0451 \u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 <code>contentHandler<\/code>.<\/p>\n<h2>4. Notification Service Extension: \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0434\u0432\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438<\/h2>\n<p>\u0412\u00a0\u0434\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0434\u0432\u0430 URL. \u0418\u0437\u00a0<code>smallImageURL<\/code>\u00a0\u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f attachment\u00a0<code>small-image<\/code>, \u0430\u00a0\u0438\u0437\u00a0<code>bigImageURL<\/code>\u2014\u00a0<code>big-image<\/code>. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0437\u0430\u0442\u0435\u043c \u044f\u0432\u043d\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432\u00a0Notification Content Extension \u0434\u043b\u044f\u00a0\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u00a0\u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435.<\/p>\n<pre><code class=\"swift\">private enum PayloadKey {    static let smallImageURL = \"smallImageURL\"    static let bigImageURL = \"bigImageURL\"}private enum AttachmentIdentifier {    static let smallImage = \"small-image\"    static let bigImage = \"big-image\"}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0435\u043b\u0430\u0435\u043c mutable\u2011\u043a\u043e\u043f\u0438\u044e <code>content<\/code> \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443:<\/p>\n<pre><code class=\"swift\">override func didReceive(    _ request: UNNotificationRequest,    withContentHandler contentHandler: @escaping (UNNotificationContent) -&gt; Void) {    self.contentHandler = contentHandler    guard let content = request.content.mutableCopy()            as? UNMutableNotificationContent else {        contentHandler(request.content)        return    }    bestAttemptContent = content    downloadImages(for: content) { [weak self] modifiedContent in        self?.finish(with: modifiedContent)    }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p><a href=\"https:\/\/developer.apple.com\/documentation\/usernotifications\/unmutablenotificationcontent\/attachments\" rel=\"noopener nofollow\"><code>Attachments<\/code><\/a> \u0434\u043e\u043b\u0436\u043d\u044b\u00a0\u0431\u044b\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 URL \u0438\u0437\u00a0payload \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 <code>UNNotificationAttachment<\/code>: \u0444\u0430\u0439\u043b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u00a0\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e.<\/p>\n<pre><code class=\"swift\">private func downloadAttachment(    from url: URL,    identifier: String,    completion: @escaping (UNNotificationAttachment?) -&gt; Void) {    let configuration = URLSessionConfiguration.ephemeral    configuration.timeoutIntervalForRequest = 10    configuration.timeoutIntervalForResource = 15    let session = URLSession(configuration: configuration)    let task = session.downloadTask(with: url) {        temporaryURL, response, error in        defer { session.finishTasksAndInvalidate() }        guard            error == nil,            let response = response as? HTTPURLResponse,            (200...299).contains(response.statusCode),            let temporaryURL        else {            completion(nil)            return        }        do {            let ext = url.pathExtension.isEmpty ? \"jpg\" : url.pathExtension            let localURL = FileManager.default.temporaryDirectory                .appendingPathComponent(UUID().uuidString)                .appendingPathExtension(ext)            try FileManager.default.copyItem(                at: temporaryURL,                to: localURL            )            let attachment = try UNNotificationAttachment(                identifier: identifier,                url: localURL,                options: nil            )            completion(attachment)        } catch {            completion(nil)        }    }    task.resume()}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0414\u0432\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435\u00a0\u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u00a0\u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438\u0445 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f. \u0412\u00a0\u0434\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e <code>identifier<\/code>, \u0430\u00a0\u0437\u0430\u0442\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 <code>attachments<\/code> \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u00a0\u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435: <code>small-image,<\/code> <code>big-image<\/code>.<\/p>\n<pre><code class=\"swift\">content.attachments = [    downloadedAttachments[\"small-image\"],    downloadedAttachments[\"big-image\"]].compactMap { $0 }<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p><strong>\u041d\u0443\u0436\u0435\u043d\u00a0\u043b\u0438 App Group \u0434\u043b\u044f\u00a0\u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 attachment \u043c\u0435\u0436\u0434\u0443 extensions?<\/strong><\/p>\n<p>\u0412\u00a0\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438\u00a0\u2014 \u043d\u0435\u0442. Notification Service Extension \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u00a0<code>UNNotificationAttachment<\/code>\u00a0\u0432\u00a0\u0438\u0437\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u0439\u00a0<code>UNNotificationContent<\/code>, \u0430\u00a0Notification Content Extension \u0437\u0430\u0442\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u044d\u0442\u0438 <code>attachments<\/code> \u0447\u0435\u0440\u0435\u0437\u00a0<code>notification.request.content.attachments<\/code>. App Group \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u043c \u0438\u043b\u0438\u00a0\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043d\u0443\u0436\u043d\u043e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438,\u00a0<code>UserDefaults<\/code>\u00a0\u0438\u043b\u0438\u00a0\u0434\u0440\u0443\u0433\u0438\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440.<\/p>\n<h2>5. \u0423\u00a0Notification Service Extension \u0435\u0441\u0442\u044c \u0434\u0435\u0434\u043b\u0430\u0439\u043d<\/h2>\n<p>Notification Service Extension \u043d\u0435\u00a0\u043c\u043e\u0436\u0435\u0442 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0434\u0430\u0442\u044c \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u041d\u0430\u00a0\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0434\u0430\u0451\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f (\u043d\u0435 \u0431\u043e\u043b\u0435\u0435 30\u00a0\u0441\u0435\u043a\u0443\u043d\u0434 \u043d\u0430\u00a0\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 <code>content<\/code> \u0438 \u0432\u044b\u0437\u043e\u0432\u00a0<code>contentHandler<\/code>). \u0415\u0441\u043b\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u043d\u0435\u00a0\u0443\u0441\u043f\u0435\u0432\u0430\u0435\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u00a0<code>serviceExtensionTimeWillExpire()<\/code>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443\u00a0\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u00a0<code>UNMutableNotificationContent<\/code>\u00a0\u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"swift\">override func serviceExtensionTimeWillExpire() {    guard let bestAttemptContent else { return }    finish(with: bestAttemptContent)}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<h2>6. Notification Content Extension \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a\u00a0\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044e. \u041e\u0434\u0438\u043d Notification Content Extension \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439. \u042d\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u00a0\u0432\u00a0Swift\u2011\u043a\u043e\u0434\u0435, \u0430\u00a0\u0432 <code>Info.plist<\/code> \u0441\u0430\u043c\u043e\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f. \u0412\u00a0\u0434\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442\u0435 <code>Info.plist<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0432\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438: <code>pushWithImageCategory<\/code> \u0438 <code>eventCategory<\/code>. \u041a\u043b\u044e\u0447 <code>UNNotificationExtensionCategory<\/code> \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u043e\u0439. \u0415\u0441\u043b\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c <code>Array<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 <code>identifier<\/code> \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c <code>Item<\/code>.<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/731\/c42\/14e\/731c4214e11f4cf64d2992cbf573c54b.png\" alt=\"Info.plist \u0432 Notification Content Extension \u0432 \u0434\u0435\u043c\u043e-\u043f\u0440\u043e\u0435\u043a\u0442\u0435\" title=\"Info.plist \u0432 Notification Content Extension \u0432 \u0434\u0435\u043c\u043e-\u043f\u0440\u043e\u0435\u043a\u0442\u0435\" width=\"1576\" height=\"472\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/731\/c42\/14e\/731c4214e11f4cf64d2992cbf573c54b.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/731\/c42\/14e\/731c4214e11f4cf64d2992cbf573c54b.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>Info.plist \u0432\u00a0Notification Content Extension \u0432\u00a0\u0434\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u00a0\u043a\u043e\u0434\u0435 \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"xml\">&lt;key&gt;UNNotificationExtensionCategory&lt;\/key&gt;&lt;array&gt;    &lt;string&gt;pushWithImageCategory&lt;\/string&gt;    &lt;string&gt;eventCategory&lt;\/string&gt;&lt;\/array&gt;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b \u043a\u00a0\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 <code>Info.plist<\/code>, <code>UNNotificationCategory<\/code> \u0438 payload \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0412\u00a0\u0434\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442\u0435\u00a0<code>UNNotificationExtensionDefaultContentHidden<\/code>\u00a0\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0432\u00a0<code>NO<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0432\u0438\u0434\u0438\u043c\u043e\u0439 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441\u00a0\u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c. \u0415\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u00a0<code>YES<\/code>, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u043a\u0440\u043e\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 Content Extension.<\/p>\n<h2>7. UI \u043a\u043e\u0434\u043e\u043c: NSExtensionPrincipalClass \u0432\u043c\u0435\u0441\u0442\u043e storyboard<\/h2>\n<p>\u041f\u0440\u0438\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 Notification Content Extension \u0441\u0430\u043c Xcode \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 storyboard, \u0447\u0442\u043e\u00a0\u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e. \u0412\u00a0\u0434\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0434\u043e\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u00a0\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0430\u0434\u0430\u0451\u0442\u0441\u044f <code>NSExtensionPrincipalClass<\/code>:<\/p>\n<pre><code class=\"xml\">&lt;key&gt;NSExtensionPrincipalClass&lt;\/key&gt;&lt;string&gt;$(PRODUCT_MODULE_NAME).NotificationViewController&lt;\/string&gt;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u0435 \u0441\u043e \u0441\u0442\u043e\u0440\u0438\u0431\u043e\u0440\u0434\u0430 \u043d\u0430\u00a0\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 <code>UIViewController<\/code>, \u043d\u0435\u00a0\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0439\u0442\u0435 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441\u0442\u0430\u0440\u044b\u0439 <code>NSExtensionMainStoryboard<\/code>. \u0423\u00a0\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430\u00a0\u0431\u044b\u0442\u044c \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430.<\/p>\n<pre><code class=\"swift\">final class NotificationViewController:    UIViewController,    UNNotificationContentExtension {    private let imageView: UIImageView = {        let imageView = UIImageView()        imageView.translatesAutoresizingMaskIntoConstraints = false        imageView.contentMode = .scaleAspectFill        imageView.clipsToBounds = true        return imageView    }()    private let calendarImageView =        makeSymbolImageView(systemName: \"calendar\")    private let locationImageView =        makeSymbolImageView(systemName: \"mappin.and.ellipse\")    private lazy var dateRowStackView =        makeEventRow(icon: calendarImageView, label: eventDateLabel)    private lazy var locationRowStackView =        makeEventRow(icon: locationImageView, label: eventLocationLabel)    private lazy var eventStackView: UIStackView = {        let stackView = UIStackView(arrangedSubviews: [            dateRowStackView,            locationRowStackView        ])        stackView.translatesAutoresizingMaskIntoConstraints = false        stackView.axis = .vertical        stackView.spacing = 12        stackView.isHidden = true        return stackView    }()    override func viewDidLoad() {        super.viewDidLoad()        view.addSubview(imageView)        view.addSubview(eventStackView)        setupConstraints()    }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<h2>8. \u041d\u0435\u00a0\u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c aps.category \u0432\u0440\u0443\u0447\u043d\u0443\u044e<\/h2>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u043f\u0443\u0448\u2011\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043d\u043e\u0432\u0430 \u043b\u0435\u0437\u0442\u044c \u0432 <code>userInfo<\/code>, \u0438\u0441\u043a\u0430\u0442\u044c <code>aps<\/code> \u0438 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0434\u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c <code>category<\/code>. <code>UserNotifications<\/code> \u0443\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043b \u044d\u0442\u043e \u0437\u0430\u00a0\u043d\u0430\u0441: \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0447\u0435\u0440\u0435\u0437 <code>content.categoryIdentifier<\/code>.<\/p>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e:<\/p>\n<pre><code class=\"swift\">let aps = content.userInfo[\"aps\"] as? [AnyHashable: Any]let category = aps?[\"category\"] as? String<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u043b\u0443\u0447\u0448\u0435:<\/p>\n<pre><code class=\"swift\">let content = notification.request.contentguard content.categoryIdentifier == \"pushWithImageCategory\" else {    return}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<h2>9. \u0411\u043e\u043b\u044c\u0448\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0432\u00a0\u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435<\/h2>\n<p>Notification Content Extension \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0443\u0436\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 <code>attachments<\/code>. \u0414\u043b\u044f\u00a0\u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e UI \u043c\u044b \u043d\u0435\u00a0\u0431\u0435\u0440\u0451\u043c \u00ab\u043f\u0435\u0440\u0432\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443\u00bb, \u0430\u00a0\u044f\u0432\u043d\u043e \u0438\u0449\u0435\u043c <code>attachment<\/code> \u0441\u00a0\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c <code>big-image<\/code>:<\/p>\n<pre><code class=\"swift\">guard let imageAttachment = content.attachments.first(where: {    $0.identifier == \"big-image\"}) else {    return}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0435\u00a0\u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 UI \u0441\u00a0\u043f\u043e\u0440\u044f\u0434\u043a\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u043f\u043e\u0437\u0436\u0435 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0434\u0438\u0430.<\/p>\n<pre><code class=\"swift\">private func loadImage(from attachment: UNNotificationAttachment) {    DispatchQueue.global(qos: .userInitiated).async { [weak self] in        let didStartAccessing =            attachment.url.startAccessingSecurityScopedResource()        defer {            if didStartAccessing {                attachment.url.stopAccessingSecurityScopedResource()            }        }        guard            let data = try? Data(contentsOf: attachment.url),            let image = UIImage(data: data)        else {            return        }        DispatchQueue.main.async {            guard let self else { return }            self.preferredContentSize =                self.preferredImageSize(for: image.size)            self.imageView.image = image        }    }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p><code>preferredContentSize<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u044b\u0441\u043e\u0442\u0443 \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441\u00a0\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u043f\u043e\u0434\u00a0\u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438. \u0412\u00a0\u0434\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u00a0\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0448\u0438\u0440\u0438\u043d\u044b \u0441\u00a0\u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c <code>aspect ratio<\/code>.<\/p>\n<h2>10. \u0412\u0442\u043e\u0440\u0430\u044f \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f: eventCategory \u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u043b\u0435\u0439\u0430\u0443\u0442<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e\u00a0\u043e\u0434\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439, \u0432\u00a0\u0434\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0435\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u0430\u044f \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u00a0\u2014 <code>eventCategory<\/code>. \u0414\u043b\u044f\u00a0\u043d\u0435\u0451 \u0442\u043e\u0442\u00a0\u0436\u0435 <code>NotificationViewController<\/code> \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u00a0\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043b\u0435\u0439\u0430\u0443\u0442: \u0434\u0432\u0435 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 <code>SF Symbols calendar<\/code> \u0438 <code>mappin.and.ellipse<\/code>\u00a0\u2014 \u0434\u0430\u0442\u043e\u0439 \u0438 \u043c\u0435\u0441\u0442\u043e\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f.<\/p>\n<pre><code class=\"swift\">private enum Category {    static let image = \"pushWithImageCategory\"    static let event = \"eventCategory\"}func didReceive(_ notification: UNNotification) {    let content = notification.request.content    switch content.categoryIdentifier {    case Category.image:        configureImageNotification(with: content)    case Category.event:        configureEventNotification(with: content)    default:        break    }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>Payload \u0434\u043b\u044f\u00a0\u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"json\">{  \"aps\": {    \"alert\": {      \"title\": \"Meetup reminder\",      \"body\": \"iOS Community Meetup\"    },    \"sound\": \"default\",    \"category\": \"eventCategory\"  },  \"eventDate\": \"October 15, 19:00\",  \"eventLocation\": \"Community Hall\"}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442\u00a0\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0441\u00a0\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438: eventCategory \u043d\u0435\u00a0\u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043c\u0435\u0434\u0438\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <code>mutable-content<\/code> \u043d\u0435\u00a0\u043d\u0443\u0436\u0435\u043d. Notification Content Extension \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u043e <code>aps.category<\/code>, \u0430 <code>eventDate<\/code> \u0438 <code>eventLocation<\/code> \u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u0438\u0437\u00a0\u043a\u043b\u044e\u0447\u0435\u0439 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f. \u0412\u00a0\u0441\u0430\u043c\u043e\u043c Notification Content Extension \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u044c <code>views<\/code> \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043b\u0435\u0439\u0430\u0443\u0442. \u0414\u0430\u0442\u0430 \u0438 \u043c\u0435\u0441\u0442\u043e \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u044b \u043a\u0430\u043a\u00a0\u0434\u0432\u0435 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441\u00a0\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c\u0438 <code>SF Symbols<\/code>:<\/p>\n<pre><code class=\"swift\">private func configureEventNotification(    with content: UNNotificationContent) {    imageView.isHidden = true    eventStackView.isHidden = false    let eventDate = content.userInfo[\"eventDate\"] as? String    let eventLocation = content.userInfo[\"eventLocation\"] as? String    eventDateLabel.text = eventDate ?? \"Date not specified\"    eventLocationLabel.text =        eventLocation ?? \"Location not specified\"    preferredContentSize = CGSize(        width: view.bounds.width,        height: 112    )}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043b\u044f\u00a0Notification Content Extension \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432\u044b\u0441\u043e\u0442\u044b\u00a0<code>preferredContentSize<\/code>: \u0448\u0438\u0440\u0438\u043d\u0443 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>width<\/code> \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0421\u0442\u0440\u043e\u043a\u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 <code>UIStackView<\/code>, \u0430\u00a0\u0438\u043a\u043e\u043d\u043a\u0438 \u0431\u0435\u0440\u0443\u0442\u0441\u044f \u0438\u0437 <code>SF Symbols<\/code>\u00a0\u2014 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 <code>assets<\/code> \u0434\u043b\u044f\u00a0\u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043d\u0435\u00a0\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"swift\">private func makeEventRow(    icon: UIImageView,    label: UILabel) -&gt; UIStackView {    let stackView = UIStackView(arrangedSubviews: [icon, label])    stackView.axis = .horizontal    stackView.alignment = .center    stackView.spacing = 10    NSLayoutConstraint.activate([        icon.widthAnchor.constraint(equalToConstant: 22),        icon.heightAnchor.constraint(equalToConstant: 22)    ])    return stackView}private static func makeSymbolImageView(    systemName: String) -&gt; UIImageView {    let imageView = UIImageView(        image: UIImage(systemName: systemName)    )    imageView.translatesAutoresizingMaskIntoConstraints = false    imageView.contentMode = .scaleAspectFit    imageView.tintColor = .label    return imageView}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<h2>11. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 Minimum Deployment \u0432\u00a0\u0442\u0430\u0440\u0433\u0435\u0442\u0430\u0445 \u0441\u00a0\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u043c\u0438<\/h2>\n<p>\u041a\u0430\u0436\u0434\u043e\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u00a0\u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0430\u0440\u0433\u0435\u0442 \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 Minimum Deployment. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u044d\u0442\u043e \u0443\u00a0\u0432\u0441\u0435\u0445 \u0442\u0440\u0451\u0445 \u0442\u0430\u0440\u0433\u0435\u0442\u043e\u0432.<\/p>\n<ul>\n<li>\n<p>PushNotificationsSample \u2192 iOS 16.0<\/p>\n<\/li>\n<li>\n<p>NotificationsServiceExtension \u2192 iOS 16.0<\/p>\n<\/li>\n<li>\n<p>NotificationsContentExtension \u2192 iOS 16.0<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u00a0Xcode \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a (\u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f, \u0432\u00a0\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442\u00a0\u0432\u0435\u0440\u0441\u0438\u0438 IDE):<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/980\/642\/03c\/98064203c72cc40585eb0c4c7ffe6ddd.png\" alt=\"Minimum Deployment target \u0432 Xcode\" title=\"Minimum Deployment target \u0432 Xcode\" width=\"1726\" height=\"298\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/980\/642\/03c\/98064203c72cc40585eb0c4c7ffe6ddd.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/980\/642\/03c\/98064203c72cc40585eb0c4c7ffe6ddd.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>Minimum Deployment target \u0432\u00a0Xcode<\/figcaption><\/div>\n<\/figure>\n<p><strong>\u0412\u0430\u0436\u043d\u0430\u044f \u0440\u0435\u043c\u0430\u0440\u043a\u0430<\/strong>: Apple \u043d\u0435\u00a0\u0442\u0440\u0435\u0431\u0443\u0435\u0442, \u0447\u0442\u043e\u0431\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0433\u0434\u0430\u00a0\u0431\u044b\u043b\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438. \u041d\u043e\u00a0\u0435\u0441\u043b\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e minimum OS, \u0447\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043d\u0430\u00a0\u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0440\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0432\u0435\u0440\u0441\u0438\u0438 iOS \u044d\u0442\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e, \u0438\u0437\u2011\u0437\u0430 \u0447\u0435\u0433\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0438\u043b\u043b\u044e\u0437\u0438\u044f, \u0447\u0442\u043e\u00a0\u0441\u0430\u043c\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u043d\u0435\u00a0\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0415\u0441\u043b\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430\u00a0\u0432\u0441\u0451\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 \u0432\u0435\u0440\u0441\u0438\u0439, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0435\u0435 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u0438 \u0442\u0430\u0440\u0433\u0435\u0442\u043e\u0432 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438. \u0412\u00a0\u0434\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0432\u0441\u0435 \u0442\u0440\u0438 \u0442\u0430\u0440\u0433\u0435\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 iOS 16.0.<\/p>\n<h2>12. \u041a\u0430\u043a\u00a0\u044d\u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/h2>\n<ol>\n<li>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438:<\/p>\n<p><code>pushWithImageCategory<\/code><\/p>\n<p><code>eventCategory<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 payload:<\/p>\n<p><code>aps.mutable-content = 1<\/code><\/p>\n<p><code>aps.category = pushWithImageCategory<\/code><\/p>\n<p><code>smallImageURL = ...<\/code><\/p>\n<p><code>bigImageURL = ...<\/code><\/p>\n<\/li>\n<li>\n<p>iOS \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 Notification Service Extension<\/p>\n<\/li>\n<li>\n<p>Service Extension:<\/p>\n<p>\u2022 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 <code>small image<\/code>;<\/p>\n<p>\u2022 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 <code>big image<\/code>;<\/p>\n<p>\u2022 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 <code>UNNotificationAttachment<\/code>;<\/p>\n<p>\u2022 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>modified content<\/code>.<\/p>\n<\/li>\n<li>\n<p>iOS \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 <code>category<\/code> \u0441 <code>UNNotificationExtensionCategory<\/code> \u0432 <code>Info.plist<\/code><\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438\u00a0\u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u0438 \u0448\u0442\u043e\u0440\u043a\u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043b\u043e\u043d\u0433\u0442\u0430\u043f\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f Notification Content Extension<\/p>\n<\/li>\n<li>\n<p><code>NotificationViewController<\/code>:<\/p>\n<p>\u2022 \u0447\u0438\u0442\u0430\u0435\u0442 <code>content.categoryIdentifier<\/code>;<\/p>\n<p>\u2022 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0432 <code>attachment<\/code> \u201c<code>big-image<\/code>\u201d;<\/p>\n<p>\u2022 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0435\u0433\u043e \u0432\u00a0\u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u043c UI.<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u043b\u044f <code>eventCategory<\/code> Notification Service Extension \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435\u00a0\u043d\u0443\u0436\u0435\u043d: \u043f\u043e\u0441\u043b\u0435 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0430\u043c\u0430 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 <code>category<\/code> \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 \u0432\u00a0Notification Content Extension, \u0430 <code>NotificationViewController<\/code> \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043b\u0435\u0439\u0430\u0443\u0442.<\/p>\n<h2>13. \u0427\u0435\u043a\u043b\u0438\u0441\u0442: \u0435\u0441\u043b\u0438 \u043f\u0443\u0448 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442, \u0430\u00a0\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u043d\u0435\u00a0\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/h2>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0435\u0441\u0442\u044c\u00a0\u043b\u0438 <code>alert<\/code> \u0432\u00a0payload, \u0435\u0441\u043b\u0438 \u0432\u044b \u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u043a Notification Service Extension?<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f\u00a0\u043b\u0438 <code>mutable-content: 1<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 <code>aps<\/code>?<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f\u00a0\u043b\u0438 <code>category<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 <code>aps<\/code>, \u0430\u00a0\u043d\u0435\u00a0\u0440\u044f\u0434\u043e\u043c \u0441\u00a0\u043d\u0438\u043c?<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442\u00a0\u043b\u0438 <code>category<\/code> \u0441 <code>identifier<\/code> \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e <code>UNNotificationCategory<\/code>?<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u0442\u044c\u00a0\u043b\u0438 \u044d\u0442\u0430\u00a0\u0436\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f \u0432 <code>UNNotificationExtensionCategory<\/code> \u0432 <code>Info.plist<\/code> \u0432\u0430\u0448\u0435\u0433\u043e Notification Content Extension?<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e, \u0438\u043c\u0435\u0435\u0442\u00a0\u043b\u0438 <code>UNNotificationExtensionCategory<\/code> \u0432 <code>Info.plist<\/code> \u0442\u0438\u043f <code>Array<\/code>?<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442\u00a0\u043b\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432\u00a0\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430\u0445?<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 UI \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u00a0\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u043d <code>NSExtensionPrincipalClass<\/code> \u0438 \u0443\u0434\u0430\u043b\u0451\u043d\u00a0\u043b\u0438 \u0441\u0442\u0430\u0440\u044b\u0439 <code>NSExtensionMainStoryboard<\/code> \u0432 <code>Info.plist<\/code>?<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f\u00a0\u043b\u0438 <code>contentHandler<\/code> \u0432\u043e\u00a0\u0432\u0441\u0435\u0445 \u043f\u0443\u0442\u044f\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f Notification Service Extension?<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u0442\u044c\u00a0\u043b\u0438 <code>fallback<\/code> \u0432 <code>serviceExtensionTimeWillExpire()<\/code>?<\/p>\n<\/li>\n<li>\n<p>\u0421\u043a\u0430\u0447\u0430\u043d\u00a0\u043b\u0438 <code>attachment<\/code> \u0432\u00a0\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0434\u043e\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f <code>UNNotificationAttachment<\/code>?<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u00a0\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u00a0\u043b\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u0435\u0435 \u043d\u043e\u0432\u0443\u044e iOS, \u0447\u0435\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u043d\u0430\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435?<\/p>\n<\/li>\n<\/ul>\n<h2>14. \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u00a0\u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0435: \u0447\u0442\u043e\u00a0\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c<\/h2>\n<p>\u0414\u043b\u044f\u00a0\u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0443\u0448\u0435\u0439 \u0432\u00a0\u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0435 \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c payload\u2011\u0444\u0430\u0439\u043b\u044b \u0441\u00a0\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c.apns. \u0422\u0430\u043a\u043e\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u044c \u0432\u00a0\u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u00a0\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 background (\u0432 \u0434\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u044f \u043d\u0435\u00a0\u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0432\u00a0\u0440\u0435\u0436\u0438\u043c\u0435 foreground), \u043d\u0430\u00a0\u044d\u043a\u0440\u0430\u043d\u0435 \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0448\u0442\u043e\u0440\u043a\u0430 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f. \u041f\u0440\u0438\u00a0\u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0432\u00a0payload \u043d\u0443\u0436\u043d\u043e\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438, \u0435\u0441\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043b\u043e\u043d\u0433\u0442\u0430\u043f \u043d\u0430\u00a0\u0448\u0442\u043e\u0440\u043a\u0435, \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u043a\u0440\u043e\u0435\u0442\u0441\u044f, \u043f\u043e\u00a0\u043d\u0443\u0436\u043d\u043e\u0439 <code>category<\/code> \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Notification Content Extension \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043b\u0435\u0439\u0430\u0443\u0442.<\/p>\n<p>\u0412\u00a0\u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b Event.apns:<\/p>\n<pre><code class=\"json\">{  \"Simulator Target Bundle\": \"com.PushNotificationsSample\",  \"aps\": {    \"alert\": {      \"title\": \"iOS Community Meetup\",      \"body\": \"Don't forget about today's meetup\"    },    \"sound\": \"default\",    \"category\": \"eventCategory\"  },  \"eventDate\": \"October 15, 19:00\",  \"eventLocation\": \"Community Hall\"}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0422\u043e\u0442\u00a0\u0436\u0435 payload \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0438\u0437\u00a0\u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430:<\/p>\n<pre><code class=\"bash\">xcrun simctl push booted com.PushNotificationsSample Event.apns<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>Bundle Identifier \u0432\u00a0\u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Simulator Target Bundle \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441\u00a0Bundle Identifier \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<h2>15. \u0414\u0435\u0431\u0430\u0433 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439<\/h2>\n<p>\u041f\u0440\u0438\u00a0\u043e\u0442\u043b\u0430\u0434\u043a\u0435 Notification Service Extension \u0438 Notification Content Extension \u0435\u0441\u0442\u044c \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442: \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0431\u0440\u0435\u0439\u043a\u043f\u043e\u0438\u043d\u0442\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u043d\u0435\u00a0\u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0432\u00a0\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u0445.<\/p>\n<p>\u0414\u043b\u044f\u00a0\u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u00a0Xcode \u0441\u0445\u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u00a0\u2014\u00a0<code>NotificationsServiceExtension<\/code>\u00a0\u0438\u043b\u0438\u00a0<code>NotificationsContentExtension<\/code>. \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Xcode \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435. \u0412\u00a0\u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e\u00a0<code>PushNotificationsSample<\/code>. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0431\u0440\u0435\u0439\u043a\u043f\u043e\u0438\u043d\u0442\u044b \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u00a0\u043a\u043e\u0434\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0438 \u0434\u0435\u0431\u0430\u0436\u0438\u0442\u044c.<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/336\/f52\/472\/336f5247285e3fc88f640f3d168457b3.png\" alt=\"\u0412\u044b\u0431\u043e\u0440 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u0442\u0430\u0440\u0433\u0435\u0442\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0434\u0435\u0431\u0430\u0433\u0430\" title=\"\u0412\u044b\u0431\u043e\u0440 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u0442\u0430\u0440\u0433\u0435\u0442\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0434\u0435\u0431\u0430\u0433\u0430\" width=\"862\" height=\"558\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/336\/f52\/472\/336f5247285e3fc88f640f3d168457b3.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/336\/f52\/472\/336f5247285e3fc88f640f3d168457b3.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0412\u044b\u0431\u043e\u0440 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u0442\u0430\u0440\u0433\u0435\u0442\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0434\u043b\u044f\u00a0\u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0434\u0435\u0431\u0430\u0433\u0430<\/figcaption><\/div>\n<\/figure>\n<h2>16. \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Notification Service Extension<\/h2>\n<p>\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u044f \u0447\u0435\u0440\u0435\u0437 drag\u2011and\u2011drop apns\u2011\u0444\u0430\u0439\u043b\u0430 \u0438\u043b\u0438\u00a0\u0447\u0435\u0440\u0435\u0437 <code>xcrun simctl push<\/code> \u043d\u0435\u00a0\u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u0430 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0439 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0435 \u0447\u0435\u0440\u0435\u0437 APNs. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0441\u00a0\u0442\u0435\u043c, \u0447\u0442\u043e\u00a0\u043f\u0440\u0438\u00a0\u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u043d\u0438\u0438 \u043d\u0430\u00a0\u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440 apns\u2011\u0444\u0430\u0439\u043b\u0430 \u0441\u00a0\u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438 \u043d\u0430\u00a0\u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043d\u0435\u00a0\u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f. Apple \u043f\u0440\u044f\u043c\u043e \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u0442, \u0447\u0442\u043e\u00a0\u043f\u0440\u0438\u00a0\u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 remote notifications \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 Notification Service Extensions \u043a\u0430\u043a\u00a0\u043f\u0440\u0438\u043c\u0435\u0440. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 <code>NotificationService.didReceive(_:withContentHandler:)<\/code> \u043f\u0440\u0438\u00a0\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0441\u0438\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043f\u0443\u0448\u2011\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0438 \u0441\u0430\u043c\u043e \u043f\u043e\u00a0\u0441\u0435\u0431\u0435 \u043d\u0435\u00a0\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u0432\u00a0\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0438 \u0438\u043b\u0438\u00a0\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441\u00a0\u0431\u0440\u0435\u0439\u043a\u043f\u043e\u0438\u043d\u0442\u0430\u043c\u0438.<\/p>\n<p>\u041d\u0430\u00a0\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 Event.apns \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f\u00a0\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 <code>category<\/code> \u0438 Notification Content Extension, \u0430\u00a0\u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0441\u00a0\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 <code>smallImageURL<\/code> \/ <code>bigImageURL<\/code> \u0447\u0435\u0440\u0435\u0437 Notification Service Extension \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u043c remote push \u0447\u0435\u0440\u0435\u0437 APNs\u00a0\u2014 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u043e\u0433\u0434\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0441\u044f \u043d\u0443\u0436\u043d\u043e\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 payload \u043f\u0443\u0448\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u044b\u0439 <code>alert<\/code>, \u0430\u00a0\u0432\u00a0\u0441\u043b\u043e\u0432\u0430\u0440\u0435 <code>aps<\/code> \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 <code>mutable-content<\/code> \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c 1. \u0423\u00a0extension \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u00a0\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <code>serviceExtensionTimeWillExpire()<\/code> \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u0445\u043e\u0432\u043a\u043e\u0439 \u043d\u0430\u00a0\u0441\u043b\u0443\u0447\u0430\u0439 \u0442\u0430\u0439\u043c\u2011\u0430\u0443\u0442\u0430.<\/p>\n<h2>\u0418\u0442\u043e\u0433<\/h2>\n<p>Rich notifications \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0442\u044c \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043a\u0430\u043a\u00a0\u0435\u0434\u0438\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c. Notification Service Extension\u00a0\u2014 \u044d\u0442\u043e \u044d\u0442\u0430\u043f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. Notification Content Extension\u00a0\u2014 \u044d\u0442\u0430\u043f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<ul>\n<li>\n<p>NotificationServiceExtension\u00a0\u2014 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c content<\/p>\n<\/li>\n<li>\n<p>NotificationContentExtension\u00a0\u2014 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c content<\/p>\n<\/li>\n<li>\n<p>mutable\u2011content\u00a0\u2014 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Service Extension<\/p>\n<\/li>\n<li>\n<p>aps.category\u00a0\u2014 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u0438\u043f \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>UNNotificationExtensionCategory\u00a0\u2014 \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u0442\u0438\u043f \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441\u00a0Content Extension<\/p>\n<\/li>\n<li>\n<p>NSExtensionPrincipalClass\u00a0\u2014 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 UIViewController \u0434\u043b\u044f\u00a0Content Extension<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0442\u0440\u0443\u0434\u043d\u043e\u0443\u043b\u043e\u0432\u0438\u043c\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u0432\u00a0\u044d\u0442\u043e\u0439 \u0441\u0445\u0435\u043c\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0435\u00a0\u0432\u00a0UIKit\u2011\u043a\u043e\u0434\u0435, \u0430\u00a0\u043d\u0430\u00a0\u0441\u0442\u044b\u043a\u0430\u0445: \u0432\u00a0\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 JSON, \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430\u0445 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439, <code>Info.plist<\/code> \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0442\u0430\u0440\u0433\u0435\u0442\u043e\u0432. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u00a0\u043e\u0442\u043b\u0430\u0434\u043a\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u0435\u0435 \u0438\u0434\u0442\u0438 \u043f\u043e\u00a0\u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0443 \u0441\u0432\u0435\u0440\u0445\u0443 \u0432\u043d\u0438\u0437\u00a0\u2014 \u043e\u0442\u00a0payload \u0434\u043e\u00a0\u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e UIViewController.<\/p>\n<h2>\u0421\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p><strong>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f Apple<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/developer.apple.com\/documentation\/usernotificationsui\/customizing-the-appearance-of-notifications\" rel=\"noopener nofollow\">Customizing the Appearance of Notifications<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/developer.apple.com\/documentation\/usernotifications\/generating-a-remote-notification\" rel=\"noopener nofollow\">Generating a remote notification<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/developer.apple.com\/documentation\/Xcode-Release-Notes\/xcode-14-release-notes\" rel=\"noopener nofollow\">Xcode 14\u00a0Release Notes<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/developer.apple.com\/documentation\/usernotificationsui\/unnotificationcontentextension\" rel=\"noopener nofollow\">UNNotificationContentExtension<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/developer.apple.com\/documentation\/usernotifications\/unnotificationserviceextension\" rel=\"noopener nofollow\">UNNotificationServiceExtension<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.kodeco.com\/8277640-push-notifications-tutorial-for-ios-rich-push-notifications\" rel=\"noopener nofollow\">Push Notifications Tutorial for iOS: Rich Push Notifications\u00a0\u2014 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=ZQX5cTp4ew0\" rel=\"noopener nofollow\">\u041a\u0430\u043a\u00a0\u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0443\u0448\u0438 \u0432\u00a0iOS\u00a0\u2014 YouTube \u0432\u0438\u0434\u0435\u043e<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=nzdd0aCebYs\" rel=\"noopener nofollow\">\u041a\u0430\u043a\u00a0\u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0443\u0448\u0438 \u0432\u00a0iOS\u00a0\u2014 YouTube \u0432\u0438\u0434\u0435\u043e<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1090524\/\">https:\/\/habr.com\/ru\/articles\/1090524\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440\u0421\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u0430 \u043d\u0430\u00a0iOS\u2011\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441\u00a0\u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u043f\u0443\u0448\u2011\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0438 \u0445\u043e\u0442\u044f\u0442 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441\u00a0Notification Service Extension \u0438 Notification Content Extension. \u0417\u0434\u0435\u0441\u044c \u043d\u0435\u00a0\u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0443\u0448\u0435\u0439 \u0441\u00a0\u043d\u0443\u043b\u044f\u00a0\u2014 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u043e\u043a\u0443\u0441 \u0441\u0434\u0435\u043b\u0430\u043d \u043d\u0430\u00a0\u0440\u0430\u0431\u043e\u0442\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 payload, \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u0445 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439, \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u043c UI \u0438 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u043f\u0440\u0438\u00a0\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435. \u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0430\u00a0\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0434\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u044b \u043d\u0430\u00a0\u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u0445. \u0426\u0435\u043b\u044c \u0441\u0442\u0430\u0442\u044c\u0438\u00a0\u2014 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u00a0\u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0434\u0435\u0442\u0430\u043b\u0438, \u043d\u0430\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0438\u00a0\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 rich notifications.\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0430\u0437\u0431\u043e\u0440 \u043d\u0430\u00a0\u0434\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442\u0435\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043f\u0443\u0448\u2011\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043d\u0435\u00a0\u0432\u0441\u0435\u0433\u0434\u0430. \u0418\u043d\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u00a0\u043f\u043e\u043a\u0430\u0437\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0434\u043b\u044f\u00a0\u0440\u0430\u0441\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0438\u043b\u0438\u00a0\u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c UIViewController. \u0422\u0430\u043a\u0438\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0435\u0449\u0451 \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c Rich Push Notifications. \u0412\u00a0\u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c, \u043a\u0430\u043a\u00a0\u0434\u043b\u044f\u00a0\u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Notification Service Extension \u0438 Notification Content Extension, \u043a\u0430\u043a\u00a0\u0441\u0432\u044f\u0437\u0430\u0442\u044c \u0438\u0445 \u0447\u0435\u0440\u0435\u0437 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u043f\u0443\u0448\u2011\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0438 Info.plist, \u0438 \u043a\u0430\u043a\u00a0\u043e\u0434\u043d\u0438\u043c Notification Content Extension \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439.\u0414\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442\u0412 \u0434\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0435\u0441\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0442\u0430\u0440\u0433\u0435\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0434\u0432\u0430 \u0442\u0430\u0440\u0433\u0435\u0442\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439:NotificationsServiceExtension\u00a0\u2014 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u043f\u0443\u0448\u2011\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434 \u043f\u043e\u043a\u0430\u0437\u043e\u043c, \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u0445 \u0432 UNNotificationAttachment.NotificationsContentExtension\u00a0\u2014 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 UI \u0434\u043b\u044f\u00a0\u0434\u0432\u0443\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439.\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u00a0\u2014 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430\u00a0\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f, \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f\u00a0\u043f\u0443\u0448\u2011\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 UNNotificationCategory.\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435\u00a0\u0437\u0430\u0432\u0438\u0441\u0435\u043b \u043e\u0442\u00a0\u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0431\u044d\u043a\u0435\u043d\u0434\u0430 \u0438\u043b\u0438\u00a0\u043f\u0443\u0448\u2011\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430, payload \u0438 \u0432\u0441\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0432\u00a0\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435.Service Extension \u0438 Content Extension\u00a0\u2014 \u043d\u0435\u00a0\u043e\u0434\u043d\u043e \u0438 \u0442\u043e\u00a0\u0436\u0435\u0414\u043b\u044f\u00a0\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u043d\u043e\u0439 \u0442\u0435\u043e\u0440\u0438\u0438 \u043e\u00a0\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u0445. \u0418\u0445 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0445\u043e\u0436\u0438, \u043d\u043e\u00a0\u0441\u0430\u043c\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0430\u00a0\u0440\u0430\u0437\u043d\u044b\u0445 \u044d\u0442\u0430\u043f\u0430\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f. Notification Service Extension \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u0435\u0433\u043e \u043f\u043e\u043a\u0430\u0437\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u0432\u00a0\u0432\u0438\u0434\u0435 attachments. Notification Content Extension \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430\u00a0\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c.\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u043f\u0440\u0438\u00a0\u0440\u0430\u0437\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445: Service Extension\u00a0\u2014 \u043f\u0440\u0438\u00a0\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441\u00a0mutable-content, \u0430\u00a0Content Extension\u00a0\u2014 \u0434\u043b\u044f\u00a0\u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0432 Info.plist \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0447\u0435\u0440\u0435\u0437\u00a0category. \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u043d\u0438 \u0432\u00a0\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u0445, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438 \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c \u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e.\u041e\u0431\u043b\u0430\u0441\u0442\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f Notification Service Extension \u0438 Notification Content Extension\u0415\u0441\u0442\u044c \u0438 \u0435\u0449\u0451 \u043e\u0434\u043d\u043e \u0432\u0430\u0436\u043d\u043e\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0435: Notification Service Extension \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f\u00a0\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u043e\u043b\u044c\u043a\u043e remote notifications, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a\u00a0Notification Content Extension \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a\u0430\u043a\u00a0\u0434\u043b\u044f\u00a0remote, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f\u00a0local notifications.1. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435: \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438\u041d\u0430\u0447\u043d\u0451\u043c \u043d\u0435\u00a0\u0441\u00a0\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439, \u0430\u00a0\u0441\u00a0\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412\u00a0\u0434\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u0432\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438:pushWithImageCategoryeventCategory\u041f\u0435\u0440\u0432\u0430\u044f \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f\u00a0\u043f\u0443\u0448\u2011\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441\u00a0\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c. \u0412\u0442\u043e\u0440\u0430\u044f\u00a0\u2014 \u0434\u043b\u044f\u00a0\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043e\u00a0\u0441\u043e\u0431\u044b\u0442\u0438\u0438 \u0441\u00a0\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u043c \u043b\u0435\u0439\u0430\u0443\u0442\u043e\u043c.private enum Category {    static let image = &#171;pushWithImageCategory&#187;    static let event = &#171;eventCategory&#187;}private func registerNotificationCategories() {    let imageCategory = UNNotificationCategory(        identifier: Category.image,        actions: [],        intentIdentifiers: [],        options: []    )    let eventCategory = UNNotificationCategory(        identifier: Category.event,        actions: [],        intentIdentifiers: [],        options: []    )    UNUserNotificationCenter.current().setNotificationCategories([        imageCategory,        eventCategory    ])}\u042d\u0442\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b\u00a0\u2014 \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0438 payload. \u0414\u043b\u044f\u00a0\u043f\u0443\u0448\u2011\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430 category \u0432\u043d\u0443\u0442\u0440\u0438 aps \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u0432\u043f\u0430\u0441\u0442\u044c \u0441 identifier \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438.2. Payload: \u0433\u0434\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u0430 \u043b\u0435\u0436\u0430\u0442\u044c \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u041e\u0434\u043d\u0430 \u0438\u0437\u00a0\u0441\u0430\u043c\u044b\u0445 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a\u00a0\u2014 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c category \u00ab\u043f\u043e\u0447\u0442\u0438 \u0442\u0443\u0434\u0430\u00bb. \u0414\u043b\u044f\u00a0APNs \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e: \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 category \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u043b\u043e\u0432\u0430\u0440\u044f aps.\u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e:{  &#171;aps&#187;: {    &#171;alert&#187;: {      &#171;title&#187;: &#171;New photo&#187;,      &#171;body&#187;: &#171;Expand the notification to see the image&#187;    },    &#171;sound&#187;: &#171;default&#187;,    &#171;mutable-content&#187;: 1,    &#171;category&#187;: &#171;pushWithImageCategory&#187;  },  &#171;smallImageURL&#187;: &#171;https:\/\/example.com\/preview.jpg&#187;,  &#171;bigImageURL&#187;: &#171;https:\/\/example.com\/content.jpg&#187;}\u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e:{  &#171;aps&#187;: {    &#171;alert&#187;: {      &#171;title&#187;: &#171;New photo&#187;,      &#171;body&#187;: &#171;Expand the notification to see the image&#187;    }  },  &#171;category&#187;: &#171;pushWithImageCategory&#187;}\u0412\u043e\u00a0\u0432\u0442\u043e\u0440\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 category \u0443\u0436\u0435 \u043d\u0435\u00a0\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c \u043a\u043b\u044e\u0447\u043e\u043c aps. \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f. \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0435\u0433\u043e \u043a\u0430\u043a category \u0434\u043b\u044f\u00a0\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0438 \u043d\u0430\u00a0URL \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439\u00a0\u2014 smallImageURL \u0438 bigImageURL, \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0440\u044f\u0434\u043e\u043c \u0441 aps, \u0430\u00a0\u043d\u0435\u00a0\u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e.3. Mutable\u2011content: \u043a\u0430\u043a\u00a0\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Notification Service Extension\u0427\u0442\u043e\u0431\u044b iOS \u043f\u0435\u0440\u0435\u0434 \u043f\u043e\u043a\u0430\u0437\u043e\u043c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0430 \u0435\u0433\u043e \u0432\u00a0Notification Service Extension, payload \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c alert \u0438 \u0444\u043b\u0430\u0433 mutable-content \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c 1 \u0432\u043d\u0443\u0442\u0440\u0438 aps:&#187;mutable-content&#187;: 1\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c didReceive(_:withContentHandler:), \u0433\u0434\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u043e\u043f\u0438\u044e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430, \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c \u0435\u0451 \u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 contentHandler.4. Notification Service Extension: \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0434\u0432\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438\u0412\u00a0\u0434\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0434\u0432\u0430 URL. \u0418\u0437\u00a0smallImageURL\u00a0\u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f attachment\u00a0small-image, \u0430\u00a0\u0438\u0437\u00a0bigImageURL\u2014\u00a0big-image. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0437\u0430\u0442\u0435\u043c \u044f\u0432\u043d\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432\u00a0Notification Content Extension \u0434\u043b\u044f\u00a0\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u00a0\u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435.private enum PayloadKey {    static let smallImageURL = &#171;smallImageURL&#187;    static let bigImageURL = &#171;bigImageURL&#187;}private enum AttachmentIdentifier {    static let smallImage = &#171;small-image&#187;    static let bigImage = &#171;big-image&#187;}\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0435\u043b\u0430\u0435\u043c mutable\u2011\u043a\u043e\u043f\u0438\u044e content \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443:override func didReceive(    _ request: UNNotificationRequest,    withContentHandler contentHandler: @escaping (UNNotificationContent) -&gt; Void) {    self.contentHandler = contentHandler    guard let content = request.content.mutableCopy()            as? UNMutableNotificationContent else {        contentHandler(request.content)        return    }    bestAttemptContent = content    downloadImages(for: content) { [weak self] modifiedContent in        self?.finish(with: modifiedContent)    }}Attachments \u0434\u043e\u043b\u0436\u043d\u044b\u00a0\u0431\u044b\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 URL \u0438\u0437\u00a0payload \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 UNNotificationAttachment: \u0444\u0430\u0439\u043b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u00a0\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e.private func downloadAttachment(    from url: URL,    identifier: String,    completion: @escaping (UNNotificationAttachment?) -&gt; Void) {    let configuration = URLSessionConfiguration.ephemeral    configuration.timeoutIntervalForRequest = 10    configuration.timeoutIntervalForResource = 15    let session = URLSession(configuration: configuration)    let task = session.downloadTask(with: url) {        temporaryURL, response, error in        defer { session.finishTasksAndInvalidate() }        guard            error == nil,            let response = response as? HTTPURLResponse,            (200&#8230;299).contains(response.statusCode),            let temporaryURL        else {            completion(nil)            return        }        do {            let ext = url.pathExtension.isEmpty ? &#171;jpg&#187; : url.pathExtension            let localURL = FileManager.default.temporaryDirectory                .appendingPathComponent(UUID().uuidString)                .appendingPathExtension(ext)            try FileManager.default.copyItem(                at: temporaryURL,                to: localURL            )            let attachment = try UNNotificationAttachment(                identifier: identifier,                url: localURL,                options: nil            )            completion(attachment)        } catch {            completion(nil)        }    }    task.resume()}\u0414\u0432\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435\u00a0\u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u00a0\u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438\u0445 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f. \u0412\u00a0\u0434\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e identifier, \u0430\u00a0\u0437\u0430\u0442\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 attachments \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u00a0\u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435: small-image, big-image.content.attachments = [    downloadedAttachments[&#171;small-image&#187;],    downloadedAttachments[&#171;big-image&#187;]].compactMap { $0 }\u041d\u0443\u0436\u0435\u043d\u00a0\u043b\u0438 App Group \u0434\u043b\u044f\u00a0\u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 attachment \u043c\u0435\u0436\u0434\u0443 extensions?\u0412\u00a0\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438\u00a0\u2014 \u043d\u0435\u0442. Notification Service Extension \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u00a0UNNotificationAttachment\u00a0\u0432\u00a0\u0438\u0437\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u0439\u00a0UNNotificationContent, \u0430\u00a0Notification Content Extension \u0437\u0430\u0442\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u044d\u0442\u0438 attachments \u0447\u0435\u0440\u0435\u0437\u00a0notification.request.content.attachments. App Group \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u043c \u0438\u043b\u0438\u00a0\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043d\u0443\u0436\u043d\u043e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438,\u00a0UserDefaults\u00a0\u0438\u043b\u0438\u00a0\u0434\u0440\u0443\u0433\u0438\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440.5. \u0423\u00a0Notification Service Extension \u0435\u0441\u0442\u044c \u0434\u0435\u0434\u043b\u0430\u0439\u043dNotification Service Extension \u043d\u0435\u00a0\u043c\u043e\u0436\u0435\u0442 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0434\u0430\u0442\u044c \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u041d\u0430\u00a0\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0434\u0430\u0451\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f (\u043d\u0435 \u0431\u043e\u043b\u0435\u0435 30\u00a0\u0441\u0435\u043a\u0443\u043d\u0434 \u043d\u0430\u00a0\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 content \u0438 \u0432\u044b\u0437\u043e\u0432\u00a0contentHandler). \u0415\u0441\u043b\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u043d\u0435\u00a0\u0443\u0441\u043f\u0435\u0432\u0430\u0435\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u00a0serviceExtensionTimeWillExpire(). \u041f\u043e\u044d\u0442\u043e\u043c\u0443\u00a0\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u00a0UNMutableNotificationContent\u00a0\u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f.override func serviceExtensionTimeWillExpire() {    guard let bestAttemptContent else { return }    finish(with: bestAttemptContent)}6. Notification Content Extension \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a\u00a0\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044e. \u041e\u0434\u0438\u043d Notification Content Extension \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439. \u042d\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u00a0\u0432\u00a0Swift\u2011\u043a\u043e\u0434\u0435, \u0430\u00a0\u0432 Info.plist \u0441\u0430\u043c\u043e\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f. \u0412\u00a0\u0434\u0435\u043c\u043e\u2011\u043f\u0440\u043e\u0435\u043a\u0442\u0435 Info.plist \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0432\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438: pushWithImageCategory \u0438 eventCategory. \u041a\u043b\u044e\u0447 UNNotificationExtensionCategory \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u043e\u0439. \u0415\u0441\u043b\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c Array \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-497398","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/497398","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=497398"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/497398\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=497398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=497398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=497398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}