{"id":941,"date":"2011-06-29T02:03:00","date_gmt":"2011-06-29T02:03:00","guid":{"rendered":"https:\/\/rawbytes.org\/?p=941"},"modified":"2025-11-24T02:59:17","modified_gmt":"2025-11-24T02:59:17","slug":"ios-notification%ef%bc%88%e9%80%9a%e7%9f%a5%ef%bc%89%e3%83%90%e3%83%83%e3%82%b8%e3%83%8a%e3%83%b3%e3%83%90%e3%83%bc%e8%a1%a8%e7%a4%ba%e3%81%ae%e8%a6%81%e7%82%b9%e3%81%a0%e3%81%91","status":"publish","type":"post","link":"https:\/\/rawbytes.org\/?p=941","title":{"rendered":"iOS Notification\uff08\u901a\u77e5\uff09\u30d0\u30c3\u30b8\u30ca\u30f3\u30d0\u30fc\u8868\u793a\u306e\u8981\u70b9\u3060\u3051"},"content":{"rendered":"<div style=\"font-family: inherit;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal;margin: 0px\"><span style=\"font-size: small;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal\">iOS<\/span><span style=\"font-size: small\">\u306eNotification\u3067\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30a2\u30a4\u30b3\u30f3\u306e\u53f3\u80a9\u306b\u6570\u5b57\uff08\u30d0\u30c3\u30b8\uff09\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3051\u3069\u3001\u305d\u306e\u6570\u5b57\u3092\u6d88\u53bb\u3059\u308b\u3068\u304d\u306b\u3061\u3087\u3063\u3068\u3057\u305f\u843d\u3068\u3057\u7a74\u304c\u3042\u308b\u306e\u3067\u30e1\u30e2\u3002\u307e\u305a\u306fUIApplication\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u53d6\u5f97\u3057\u3066\u76f4\u63a5\u30d0\u30c3\u30b8\u3092\u8a2d\u5b9a\u3059\u308b\u5834\u5408\u3002<\/span><\/div>\n<div style=\"font-family: inherit;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal;margin: 0px;min-height: 13px\"><span style=\"font-size: small\"><br \/>\n<\/span><\/div>\n<div style=\"font-family: inherit;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal;margin: 0px\"><span style=\"font-size: small\">\uff08\uff11\uff09\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08<\/span><span style=\"font-size: small;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal\">UIApplication<\/span><span style=\"font-size: small\">\uff09\u3092\u901a\u3058\u3066\u76f4\u63a5\u3001\u30d0\u30c3\u30b8\u8a2d\u5b9a\u3059\u308b\u5834\u5408<\/span><\/div>\n<div style=\"font-family: inherit;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal;margin: 0px\"><span style=\"font-size: small\">[UIApplication sharedApplication].applicationIconBadgeNumber = badgeNumber;<\/span><\/div>\n<div style=\"font-family: inherit;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal;margin: 0px;min-height: 13px\"><span style=\"font-size: small\"><br \/>\n<\/span><\/div>\n<div style=\"font-family: inherit;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal;margin: 0px\"><span style=\"font-size: small\">\u3053\u306e\u5834\u5408\u306f\u3001<\/span><span style=\"font-size: small;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal\">badgeNumber<\/span><span style=\"font-size: small\">\uff08NSInteger\uff09\u306e\u6570\u5b57\u304c\u6b63\u306e\u6570\u3067\u3042\u308c\u3070\u3001\u30d0\u30c3\u30b8\u6570\u5b57\u304c\u8868\u793a\u3001\u30bc\u30ed\u3067\u3042\u308c\u3070\u30d0\u30c3\u30b8\u30a2\u30a4\u30b3\u30f3\u306f\u6d88\u53bb\u3055\u308c\u308b\u3002<\/span><\/div>\n<div style=\"font-family: inherit;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal;margin: 0px\"><span style=\"font-size: small\">\u3067\u306f\u30ed\u30fc\u30ab\u30eb\u901a\u77e5\u3092\u901a\u3058\u305f\u5834\u5408\u306f\u3069\u3046\u306a\u308b\u304b\u3002<\/span><\/div>\n<div style=\"font-family: inherit;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal;margin: 0px;min-height: 13px\"><span style=\"font-size: small\"><br \/>\n<\/span><\/div>\n<div style=\"font-family: inherit;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal;margin: 0px\"><span style=\"font-size: small\">\uff08\uff12\uff09\u30ed\u30fc\u30ab\u30eb\u901a\u77e5\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08UI<\/span><span style=\"font-size: small;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal\">LocalNotification<\/span><span style=\"font-size: small\">\uff09\u3092\u901a\u3058\u305f\u30d0\u30c3\u30b8\u8a2d\u5b9a\u306e\u5834\u5408\u3002\u3061\u306a\u307f\u306b\u30ed\u30fc\u30ab\u30eb\u901a\u77e5\u306fiOS4\u304b\u3089\u5229\u7528\u53ef\u80fd<\/span><\/div>\n<div style=\"font-family: inherit;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal;margin: 0px\"><span style=\"font-size: small\">NSInteger badgeNumber = 1;<\/span><\/div>\n<div style=\"font-family: inherit;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal;margin: 0px\"><span style=\"font-size: small\">UILocalNotification *notification = [[UILocalNotification alloc] init];<\/span><\/div>\n<div style=\"font-family: inherit;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal;margin: 0px\"><span style=\"font-size: small\">notification.fireDate = [NSDate dateWithTimeIntervalSinceNow:30];\/\/30<\/span><span style=\"font-size: small;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal\">\u79d2\u5f8c<\/span><\/div>\n<div style=\"font-family: inherit;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal;margin: 0px\"><span style=\"font-size: small\">notification.alertBody = <\/span><span style=\"color: #d12e1b;font-size: small\">@&#8221;<\/span><span style=\"color: #d12e1b;font-size: small;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal\">\u30ed\u30fc\u30ab\u30eb\u901a\u77e5\u30e1\u30c3\u30bb\u30fc\u30b8<\/span><span style=\"color: #d12e1b;font-size: small\">&#8220;<\/span><span style=\"font-size: small\">;<\/span><\/div>\n<div style=\"font-family: inherit;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal;margin: 0px\"><span style=\"font-size: small\">notification.applicationIconBadgeNumber = badgeNumber;<\/span><\/div>\n<div style=\"font-family: inherit;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal;margin: 0px\"><span style=\"font-size: small\">[[UIApplication sharedApplication] scheduleLocalNotification:notification];<\/span><\/div>\n<div style=\"font-family: inherit;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal;margin: 0px\"><span style=\"font-size: small\">[notification release];<\/span><\/div>\n<div style=\"font-family: inherit;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal;margin: 0px;min-height: 13px\"><span style=\"font-size: small\"><br \/>\n<\/span><\/div>\n<div style=\"font-family: inherit;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal;margin: 0px\"><span style=\"font-size: small;font-style: normal;font-variant: normal;font-weight: normal;line-height: normal\">badgeNumber<\/span><span style=\"font-size: small\">\u304c\u6b63\u306e\u6570\u3067\u3042\u308c\u3070\u3001\u901a\u77e5\u6642\u306b\u8a72\u5f53\u30a2\u30d7\u30ea\u306e\u30d0\u30c3\u30b8\u306b\u305d\u306e\u6570\u5b57\u304c\u8a2d\u5b9a\u3055\u308c\u308b\u3002\u3057\u304b\u3057\u30bc\u30ed\u306e\u5834\u5408\u306f\u3001\u76f4\u524d\u306e\u30d0\u30c3\u30b8\u6570\u5b57\u304c\u305d\u306e\u307e\u307e\u6b8b\u308b\u3002\u6d88\u53bb\u3057\u305f\u3044\u5834\u5408\u306f\u3001applicationBadgeNumber\u306b\u8ca0\u306e\u6570\u3092\u8a2d\u5b9a\u3059\u308c\u3070\u826f\u3044\u3002\u3061\u306a\u307f\u306b\uff08\uff11\uff09\u306e\u30d1\u30bf\u30fc\u30f3\u306e\u3068\u304d\u3082\u30bc\u30ed\u3067\u306a\u304f\u8ca0\u306e\u6570\u3092\u4e0e\u3048\u3066\u3082\u30d0\u30c3\u30b8\u306f\u6d88\u3048\u308b\u3002<\/span><\/div>\n","protected":false},"excerpt":{"rendered":"<p>iOS\u306eNotification\u3067\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30a2\u30a4\u30b3\u30f3\u306e\u53f3\u80a9\u306b\u6570\u5b57\uff08\u30d0\u30c3\u30b8\uff09\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3051\u3069\u3001\u305d\u306e\u6570\u5b57\u3092\u6d88\u53bb\u3059\u308b\u3068\u304d\u306b\u3061\u3087\u3063\u3068\u3057\u305f\u843d\u3068\u3057\u7a74\u304c\u3042\u308b\u306e\u3067\u30e1\u30e2\u3002\u307e\u305a\u306fUIApplication\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u53d6\u5f97\u3057\u3066\u76f4\u63a5\u30d0\u30c3\u30b8\u3092\u8a2d\u5b9a\u3059\u308b\u5834\u5408\u3002 \uff08\uff11\uff09\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08UIApplication\uff09\u3092\u901a\u3058\u3066\u76f4\u63a5\u3001\u30d0\u30c3\u30b8\u8a2d\u5b9a\u3059\u308b\u5834\u5408 [UIApplication sharedApplication].applicationIconBadgeNumber = badgeNumber; \u3053\u306e\u5834\u5408\u306f\u3001badgeNumber\uff08NSInteger\uff09\u306e\u6570\u5b57\u304c\u6b63\u306e\u6570\u3067\u3042\u308c\u3070\u3001\u30d0\u30c3\u30b8\u6570\u5b57\u304c\u8868\u793a\u3001\u30bc\u30ed\u3067\u3042\u308c\u3070\u30d0\u30c3\u30b8\u30a2\u30a4\u30b3\u30f3\u306f\u6d88\u53bb\u3055\u308c\u308b\u3002 \u3067\u306f\u30ed\u30fc\u30ab\u30eb\u901a\u77e5\u3092\u901a\u3058\u305f\u5834\u5408\u306f\u3069\u3046\u306a\u308b\u304b\u3002 \uff08\uff12\uff09\u30ed\u30fc\u30ab\u30eb\u901a\u77e5\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08UILocalNotification\uff09\u3092\u901a\u3058\u305f\u30d0\u30c3\u30b8\u8a2d\u5b9a\u306e\u5834\u5408\u3002\u3061\u306a\u307f\u306b\u30ed\u30fc\u30ab\u30eb\u901a\u77e5\u306fiOS4\u304b\u3089\u5229\u7528\u53ef\u80fd NSInteger badgeNumber = 1; UILocalNotification *notification = [[UILocalNotification alloc] init]; notification.fireDate = [NSDate dateWithTimeIntervalSinceNow:30];\/\/30\u79d2\u5f8c notification.alertBody = @&#8221;\u30ed\u30fc\u30ab\u30eb\u901a\u77e5\u30e1\u30c3\u30bb\u30fc\u30b8&#8220;; notification.applicationIconBadgeNumber = badgeNumber; [[UIApplication sharedApplication] scheduleLocalNotification:notification]; [notification release]; badgeNumber\u304c\u6b63\u306e\u6570\u3067\u3042\u308c\u3070\u3001\u901a\u77e5\u6642\u306b\u8a72\u5f53\u30a2\u30d7\u30ea\u306e\u30d0\u30c3\u30b8\u306b\u305d\u306e\u6570\u5b57\u304c\u8a2d\u5b9a\u3055\u308c\u308b\u3002\u3057\u304b\u3057\u30bc\u30ed\u306e\u5834\u5408\u306f\u3001\u76f4\u524d\u306e\u30d0\u30c3\u30b8\u6570\u5b57\u304c\u305d\u306e\u307e\u307e\u6b8b\u308b\u3002\u6d88\u53bb\u3057\u305f\u3044\u5834\u5408\u306f\u3001applicationBadgeNumber\u306b\u8ca0\u306e\u6570\u3092\u8a2d\u5b9a\u3059\u308c\u3070\u826f\u3044\u3002\u3061\u306a\u307f\u306b\uff08\uff11\uff09\u306e\u30d1\u30bf\u30fc\u30f3\u306e\u3068\u304d\u3082\u30bc\u30ed\u3067\u306a\u304f\u8ca0\u306e\u6570\u3092\u4e0e\u3048\u3066\u3082\u30d0\u30c3\u30b8\u306f\u6d88\u3048\u308b\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,21,23,29],"tags":[],"class_list":["post-941","post","type-post","status-publish","format-standard","hentry","category-develop","category-howto","category-ios","category-objective-c"],"_links":{"self":[{"href":"https:\/\/rawbytes.org\/index.php?rest_route=\/wp\/v2\/posts\/941","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rawbytes.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rawbytes.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rawbytes.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rawbytes.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=941"}],"version-history":[{"count":1,"href":"https:\/\/rawbytes.org\/index.php?rest_route=\/wp\/v2\/posts\/941\/revisions"}],"predecessor-version":[{"id":942,"href":"https:\/\/rawbytes.org\/index.php?rest_route=\/wp\/v2\/posts\/941\/revisions\/942"}],"wp:attachment":[{"href":"https:\/\/rawbytes.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=941"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rawbytes.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=941"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rawbytes.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=941"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}