{"id":3572,"date":"2014-11-30T12:41:46","date_gmt":"2014-11-30T03:41:46","guid":{"rendered":"http:\/\/www.lancard.com\/blog\/?p=3572"},"modified":"2025-03-12T11:28:22","modified_gmt":"2025-03-12T02:28:22","slug":"ios%e3%81%a7%e3%83%97%e3%83%83%e3%82%b7%e3%83%a5%e9%80%9a%e7%9f%a5%e6%99%82%e3%81%ae%e6%8c%99%e5%8b%95%e3%82%92%e7%a2%ba%e8%aa%8d%e3%81%97%e3%81%9f%e3%81%84","status":"publish","type":"post","link":"https:\/\/www.lancard.com\/blog\/2014\/11\/30\/ios%e3%81%a7%e3%83%97%e3%83%83%e3%82%b7%e3%83%a5%e9%80%9a%e7%9f%a5%e6%99%82%e3%81%ae%e6%8c%99%e5%8b%95%e3%82%92%e7%a2%ba%e8%aa%8d%e3%81%97%e3%81%9f%e3%81%84\/","title":{"rendered":"iOS\u3067\u30d7\u30c3\u30b7\u30e5\u901a\u77e5\u6642\u306e\u6319\u52d5\u3092\u78ba\u8a8d\u3057\u305f\u3044"},"content":{"rendered":"<p>\u4eca\u56de\u306fiOS\u30a2\u30d7\u30ea\u3092\u958b\u767a\u3057\u3066\u3044\u308b\u969b\u306b\u30d7\u30c3\u30b7\u30e5\u901a\u77e5\u6642\u306e\u6319\u52d5\u3092\u78ba\u8a8d\u3057\u305f\u3044\u6642\u306b\u4f7f\u3048\u305d\u3046\u306a\u300chouston\u300d\u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p><a title=\"nomad\/houston\" href=\"https:\/\/github.com\/nomad\/Houston\">nomad\/houston<\/a><\/p>\n<p>1. \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<pre lang=\"groovy\">gem install houston\r\n<\/pre>\n<p>2. \u9001\u4fe1\u7528\u306eruby\u30d5\u30a1\u30a4\u30eb\u3092\u7528\u610f<\/p>\n<p>\u307b\u307cREADME\u306b\u3042\u3063\u305f\u30b5\u30f3\u30d7\u30eb\u306e\u901a\u308a\u306e\u3082\u306e\u3067\u3059\u3002<br \/>\n\u307e\u305f\u3001\u4e8b\u524d\u306b\u958b\u767a\u7528\u306e\u300cpush_dev.pem\u300d\u3092\u540c\u3058\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u7f6e\u3044\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>push.ruby<\/p>\n<pre lang=\"ruby\">require 'houston'\r\n\r\n# Environment variables are automatically read, or can be overridden by any specified options. You can also\r\n# conveniently use `Houston::Client.development` or `Houston::Client.production`.\r\nAPN = Houston::Client.development\r\nAPN.certificate = File.read(\"push_dev.pem\")\r\n\r\n# An example of the token sent back when a device registers for notifications\r\ntoken = \"<\u300a\u3053\u3053\u306b\u30d7\u30c3\u30b7\u30e5\u901a\u77e5\u3092\u9001\u4fe1\u3057\u305f\u3044\u7aef\u672b\u306e\u30c7\u30d0\u30a4\u30b9\u30c8\u30fc\u30af\u30f3\u3092\u6307\u5b9a\u3057\u307e\u3059\u300b>\"\r\n\r\n# Create a notification that alerts a message to the user, plays a sound, and sets the badge on the app\r\nnotification = Houston::Notification.new(device: token)\r\nnotification.alert = \"\u30cf\u30ed\u30fc, \u30ef\u30fc\u30eb\u30c9!\"\r\n\r\n# Notifications can also change the badge count, have a custom sound, have a category identifier, indicate available Newsstand content, or pass along arbitrary data.\r\nnotification.badge = 1\r\nnotification.sound = \"sosumi.aiff\"\r\nnotification.category = \"INVITE_CATEGORY\"\r\nnotification.content_available = true\r\nnotification.custom_data = {foo: \"bar\"}\r\n\r\n# And... sent! That's all it takes.\r\nAPN.push(notification)\r\n<\/pre>\n<p>3. push\u901a\u77e5\u3092\u9001\u4fe1<\/p>\n<pre lang=\"groovy\">ruby push.ruby\r\n<\/pre>\n<p>\u4ee5\u4e0a\u3067\u3001\u6307\u5b9a\u3057\u305f\u7aef\u672b\u306b\u30d7\u30c3\u30b7\u30e5\u901a\u77e5\u304c\u98db\u3073\u307e\u3059\u3002<br \/>\nREADME\u306b\u306f\u30c7\u30d0\u30a4\u30b9\u30c8\u30fc\u30af\u30f3\u306e\u53d6\u5f97\u65b9\u6cd5\u3084\u8a3c\u660e\u66f8\u306e\u4f5c\u6210\u65b9\u6cd5\u306a\u3069\u3082\u8f09\u3063\u3066\u304a\u308a\u3059\u3054\u304f\u5206\u304b\u308a\u3084\u3059\u3044\u3067\u3059\u3002<br \/>\n\u3053\u306e\u4ed6\u306b\u3082\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089\u30d7\u30c3\u30b7\u30e5\u901a\u77e5\u3092\u9001\u4fe1\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<pre lang=\"groovy\">apn push \"<\u30c7\u30d0\u30a4\u30b9\u30c8\u30fc\u30af\u30f3>\" -c \/path\/to\/apple_push_notification.pem -m \"Hello from the command line!\"\r\n<\/pre>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3572&#038;t=iOS%E3%81%A7%E3%83%97%E3%83%83%E3%82%B7%E3%83%A5%E9%80%9A%E7%9F%A5%E6%99%82%E3%81%AE%E6%8C%99%E5%8B%95%E3%82%92%E7%A2%BA%E8%AA%8D%E3%81%97%E3%81%9F%E3%81%84&#038;s=100&#038;p&#091;url&#093;=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3572&#038;p&#091;images&#093;&#091;0&#093;=&#038;p&#091;title&#093;=iOS%E3%81%A7%E3%83%97%E3%83%83%E3%82%B7%E3%83%A5%E9%80%9A%E7%9F%A5%E6%99%82%E3%81%AE%E6%8C%99%E5%8B%95%E3%82%92%E7%A2%BA%E8%AA%8D%E3%81%97%E3%81%9F%E3%81%84\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/facebook.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"http:\/\/twitter.com\/share?url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3572&#038;text=iOS%E3%81%A7%E3%83%97%E3%83%83%E3%82%B7%E3%83%A5%E9%80%9A%E7%9F%A5%E6%99%82%E3%81%AE%E6%8C%99%E5%8B%95%E3%82%92%E7%A2%BA%E8%AA%8D%E3%81%97%E3%81%9F%E3%81%84\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3572&#038;title=iOS%E3%81%A7%E3%83%97%E3%83%83%E3%82%B7%E3%83%A5%E9%80%9A%E7%9F%A5%E6%99%82%E3%81%AE%E6%8C%99%E5%8B%95%E3%82%92%E7%A2%BA%E8%AA%8D%E3%81%97%E3%81%9F%E3%81%84\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-tumblr nolightbox\" data-provider=\"tumblr\" target=\"_blank\" rel=\"nofollow\" title=\"Share on tumblr\" href=\"https:\/\/tumblr.com\/share?s=&#038;v=3&#038;t=iOS%E3%81%A7%E3%83%97%E3%83%83%E3%82%B7%E3%83%A5%E9%80%9A%E7%9F%A5%E6%99%82%E3%81%AE%E6%8C%99%E5%8B%95%E3%82%92%E7%A2%BA%E8%AA%8D%E3%81%97%E3%81%9F%E3%81%84&#038;u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3572\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"tumblr\" title=\"Share on tumblr\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/tumblr.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=iOS%E3%81%A7%E3%83%97%E3%83%83%E3%82%B7%E3%83%A5%E9%80%9A%E7%9F%A5%E6%99%82%E3%81%AE%E6%8C%99%E5%8B%95%E3%82%92%E7%A2%BA%E8%AA%8D%E3%81%97%E3%81%9F%E3%81%84&#038;body=%E3%82%B7%E3%82%A7%E3%82%A2%E3%81%99%E3%82%8B%EF%BC%9A:%20https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3572\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/mail.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>\u4eca\u56de\u306fiOS\u30a2\u30d7\u30ea\u3092\u958b\u767a\u3057\u3066\u3044\u308b\u969b\u306b\u30d7\u30c3\u30b7\u30e5\u901a\u77e5\u6642\u306e\u6319\u52d5\u3092\u78ba\u8a8d\u3057\u305f\u3044\u6642\u306b\u4f7f\u3048\u305d\u3046\u306a\u300chouston\u300d\u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002 nomad\/houston 1. \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb gem install hou [&hellip;]<\/p>\n","protected":false},"author":23,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[124],"tags":[122],"class_list":["post-3572","post","type-post","status-publish","format-standard","hentry","category-ios","tag-push-notification"],"_links":{"self":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/3572","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/users\/23"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/comments?post=3572"}],"version-history":[{"count":8,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/3572\/revisions"}],"predecessor-version":[{"id":3588,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/3572\/revisions\/3588"}],"wp:attachment":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/media?parent=3572"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/categories?post=3572"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/tags?post=3572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}