{"id":1474,"date":"2014-12-24T21:33:08","date_gmt":"2014-12-24T12:33:08","guid":{"rendered":"http:\/\/kazu.tv\/blog\/?p=1474"},"modified":"2014-12-24T21:33:52","modified_gmt":"2014-12-24T12:33:52","slug":"cordova-3-6-geolocation-plugin-in-ios-8","status":"publish","type":"post","link":"https:\/\/kazu.tv\/blog\/2014\/12\/24\/cordova-3-6-geolocation-plugin-in-ios-8\/","title":{"rendered":"Cordova 3.6 + Geolocation plugin in iOS 8"},"content":{"rendered":"<h2>Cordova + Geolocation Plugin \u3067 iOS\u30a2\u30d7\u30ea\u3092\u4f5c\u3063\u3066\u308b<\/h2>\n<p>Cordova \u3067 iOS \u30a2\u30d7\u30ea\u3092\u521d\u3081\u3066\u4f5c\u3063\u3066\u308b\u3002JavaScript \u306f\u6bd4\u8f03\u7684\u5f97\u610f\u306a\u306e\u3067\u3001HTML + JS \u3067\u7c21\u5358\u306b\u30a2\u30d7\u30ea\u304c\u4f5c\u308c\u3066\u4fbf\u5229\u3002<\/p>\n<p>\u30b9\u30de\u30db\u30a2\u30d7\u30ea\u306e\u5834\u5408\u3001\u4f4d\u7f6e\u60c5\u5831\u6a5f\u80fd\u3092\u4f7f\u3063\u305f\u3082\u306e\u304c\u591a\u304f\u3066\u3001\u305d\u306e\u5834\u5408\u306b\u306f Cordova \u306e Geolocation plugin \u3068\u3044\u3046\u3082\u306e\u304c\u4f7f\u3048\u308b\u3093\u3060\u3051\u3069\u30012\u70b9\u307b\u3069\u3064\u3063\u304b\u3048\u305f\u3068\u3053\u308d\u304c\u3042\u3063\u305f\u306e\u3067\u30e1\u30e2\u3002<\/p>\n<h3>\u74b0\u5883<\/h3>\n<ul>\n<li>Apache Cordova 3.6.3<\/li>\n<li><a title=\"Cordova Geolocation plugin\" href=\"https:\/\/github.com\/apache\/cordova-plugin-geolocation\" target=\"_blank\">Geolocation plugin<\/a> 0.3.11<\/li>\n<li>\uff08\u591a\u5206\u3042\u307e\u308a\u95a2\u4fc2\u306a\u3044\u3051\u3069\uff09Xcode 6.1.1<\/li>\n<\/ul>\n<p>\u5bfe\u8c61\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u306f\u3001\u4eca\u306e\u6240 iOS \u306e\u307f\u3002<\/p>\n<h2>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u304b<\/h2>\n<p>\u901a\u5e38\u901a\u308a plugin \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308c\u3070\u3044\u3044\u306e\u3067\u3001\u7701\u7565\u3002<\/p>\n<h2>\u4f7f\u3063\u3066\u307f\u305f\u3089\u3001\u30a8\u30e9\u30fc\u304c2\u3064\u307b\u3069<\/h2>\n<h3>1. plist \u306b\u4f55\u304b\u5fc5\u8981\u3089\u3057\u3044\u304c\u30fb\u30fb\u30fb<\/h3>\n<p>\u4e00\u3064\u76ee\u306e\u30a8\u30e9\u30fc\u306f\u3001\u4ee5\u4e0b\u306e\u69d8\u306a\u30ed\u30b0\u3002<\/p>\n<pre class=\"brush: plain\">[Warning] No NSLocationAlwaysUsageDescription or NSLocationWhenInUseUsageDescription key is\r\n defined in the Info.plist file.<\/pre>\n<p>\u30b0\u30b0\u3063\u3066\u307f\u308b\u3068\u3001SO\u306b<a title=\"Location Services not working in iOS 8\" href=\"http:\/\/stackoverflow.com\/questions\/24062509\/location-services-not-working-in-ios-8\" target=\"_blank\">\u3053\u3093\u306a\u306e<\/a>\u304c\u3002 Info.plist \u306b\u8a18\u8ff0\u3092\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3089\u3057\u3044\uff1f<\/p>\n<p>\u3067\u3082\u3001<a title=\" iOS 8.0\u5bfe\u5fdc\u306e\u305f\u3081\u306b\u50d5\u304c\u82e6\u52b4\u3057\u305f\u3053\u3068\uff08Location\u304c\u53d6\u308c\u306a\u3044\u3001Enterprise App\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u51fa\u6765\u306a\u3044\uff09\" href=\"http:\/\/artisanedge.jp\/blog\/2014\/10\/09\/200059.html\" target=\"_blank\">\u3053\u306e\u8fba<\/a>\u3084\u3001\u30aa\u30d5\u30a3\u30b7\u30e3\u30eb\u306e\u60c5\u5831\uff08<a title=\"Cordova | Plugins Release: September 22, 2014\" href=\"http:\/\/cordova.apache.org\/news\/2014\/09\/17\/plugins-release.html\" target=\"_blank\">\u3053\u308c<\/a>\u3084<a title=\"[Geolocation][iOS 8] not working when built with Xcode 6\" href=\"https:\/\/issues.apache.org\/jira\/browse\/CB-7158\" target=\"_blank\">\u3053\u308c<\/a>\uff09\u898b\u308b\u3068plugin\u304ciOS\u306b\u5bfe\u5fdc\u3057\u305f\u3063\u3066\u66f8\u3044\u3066\u3042\u3063\u3066\u3001\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u3082\u7279\u306bplist\u3092\u76f4\u63a5\u3044\u3058\u308b\u3088\u3046\u306a\u4e8b\u3082\u66f8\u3044\u3066\u306a\u3044\u3002<\/p>\n<p>\u7d50\u8ad6\u304b\u3089\u8a00\u3046\u3068\u3001\u6700\u65b0\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u3063\u3066\u3044\u308c\u3070\u554f\u984c\u306a\u3044\u3002<\/p>\n<p>\u81ea\u5206\u306e\u5834\u5408\u306f\u3001plist \u3092\u624b\u52d5\u3067\u30b4\u30cb\u30e7\u30b4\u30cb\u30e7\u4fee\u6b63\u3059\u308bhook\u3092\u4f7f\u3063\u3066\u3044\u305f\u306e\u3067\u3001\u305d\u308c\u304c\u539f\u56e0\u3060\u3063\u305f\u3002<\/p>\n<h3>2. getCurrentPosition \u304c\u5931\u6557<\/h3>\n<p>\u3088\u3046\u3084\u304f\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u52d5\u4f5c\u3057\u305f\u3068\u601d\u3063\u305f\u3089\u3001\u4ee5\u4e0b\u306e\u69d8\u306a\u30a8\u30e9\u30fc\u304c\u3002<\/p>\n<p>1\u884c\u76ee\u306f\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u76f4\u63a5\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u51fa\u529b\u3057\u305f\uff08\uff1f\uff09\u30ed\u30b0\u3067\u30012\u884c\u76ee\u30683\u884c\u76ee\u306f\u3001navigator.geolocation.getCurrentPosition \u306e\u7b2c2\u5f15\u6570\u306e\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\uff08\u30a8\u30e9\u30fc\u6642\u306b\u547c\u3070\u308c\u308b\uff09\u95a2\u6570\u306e\u4e2d\u3067\u3001\u53d7\u3051\u53d6\u3063\u305f\u30a8\u30e9\u30fc\u30b3\u30fc\u30c9\u3068\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3055\u305b\u305f\u3082\u306e\u3002<\/p>\n<pre class=\"brush: plain\">locationManager::didFailWithError (null)\r\ncode: 2\r\nmessage: The operation couldn&lt;E2&gt;&lt;80&gt;&lt;99&gt;t be completed. (kCLErrorDomain error 0.)<\/pre>\n<p>\u3053\u308c\u306f\u3001\u3069\u3046\u3084\u3089iPhone Simulator \u306e\u307f\u3067\u8d77\u3053\u308b\u554f\u984c\u3063\u307d\u3044\u3002SO\u306e<a title=\"Geolocation is not working in iOS 8 simulator\" href=\"http:\/\/stackoverflow.com\/questions\/25972819\/geolocation-is-not-working-in-ios-8-simulator\/26237476#26237476\" target=\"_blank\">\u3053\u308c<\/a>\u3092\u898b\u3066\u3001\u30c0\u30e1\u5143\u3067Debug -&gt; Location \u3067 &#8220;Custom Location&#8221; \u4ee5\u5916\u3092\u9078\u629e\u3057\u305f\u3089\u554f\u984c\u304c\u89e3\u6d88\u3057\u305f\u3002\u305d\u306e\u5f8c\u3001\u518d\u5ea6 Custom Location \u3092\u9078\u629e\u3057\u3066\u3082\u554f\u984c\u306a\u3057\u3002<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>Cordova + Geolocation plugin \u306f\u4fbf\u5229\u3060\u3051\u3069\u3001\u30a8\u30e9\u30fc\u304c\u8d77\u304d\u305f\u6642\u306e\u60c5\u5831\u304c\u3061\u3087\u3063\u3068\u5c11\u306a\u304f\u3066\u3001\u4e88\u60f3\u5916\u306b\u6642\u9593\u304c\u304b\u304b\u3063\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u3042\u308b\u306a\u3041\u3068\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cordova + Geolocation Plugin \u3067 iOS\u30a2\u30d7\u30ea\u3092\u4f5c\u3063\u3066\u308b Cordova \u3067 iOS \u30a2\u30d7\u30ea\u3092\u521d\u3081\u3066\u4f5c\u3063\u3066\u308b\u3002JavaScript \u306f\u6bd4\u8f03\u7684\u5f97\u610f\u306a\u306e\u3067\u3001HTML + JS \u3067\u7c21\u5358\u306b\u30a2\u30d7\u30ea\u304c\u4f5c\u308c&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[8],"tags":[935,936],"class_list":["post-1474","post","type-post","status-publish","format-standard","hentry","category-8","tag-cordova","tag-ios"],"_links":{"self":[{"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/posts\/1474","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/comments?post=1474"}],"version-history":[{"count":2,"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/posts\/1474\/revisions"}],"predecessor-version":[{"id":1476,"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/posts\/1474\/revisions\/1476"}],"wp:attachment":[{"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/media?parent=1474"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/categories?post=1474"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/tags?post=1474"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}