{"id":186532,"date":"2023-09-19T12:10:27","date_gmt":"2023-09-19T04:10:27","guid":{"rendered":"http:\/\/www.idc.net\/help\/186532\/"},"modified":"2023-09-19T12:10:27","modified_gmt":"2023-09-19T04:10:27","slug":"%e5%90%8e%e6%b5%aa%e4%ba%91%e7%99%be%e5%ba%a6%e5%b0%8f%e7%a8%8b%e5%ba%8f%e6%95%99%e7%a8%8b%ef%bc%9aswan-startlocationupdate","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/186532\/","title":{"rendered":"\u540e\u6d6a\u4e91\u767e\u5ea6\u5c0f\u7a0b\u5e8f\u6559\u7a0b\uff1aswan.startLocationUpdate"},"content":{"rendered":"<ul>\n<li>swan.startLocationUpdate\n<ul>\n<li>\u65b9\u6cd5\u53c2\u6570\n<ul>\n<li>object \u53c2\u6570\u8bf4\u660e<\/li>\n<\/ul>\n<\/li>\n<li>\u793a\u4f8b\n<ul>\n<li>\u56fe\u7247\u793a\u4f8b<\/li>\n<li>\u4ee3\u7801\u793a\u4f8b\n<ul><\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h1><span><\/span>swan.startLocationUpdate<\/h1>\n<blockquote>\n<p>\u57fa\u7840\u5e93 3.150.1 \u7248\u672c\u5f00\u59cb\u652f\u6301\u3002<\/p>\n<\/blockquote>\n<p><strong>\u89e3\u91ca<\/strong>\uff1a\u5f00\u542f\u5c0f\u7a0b\u5e8f\u8fdb\u5165\u524d\u53f0\u65f6\u63a5\u6536\u4f4d\u7f6e\u6d88\u606f\u3002<br \/><strong>Web \u6001\u8bf4\u660e<\/strong>\uff1a\u53d7\u6d4f\u89c8\u5668\u9650\u5236\uff0c\u8be5\u529f\u80fd\u65e0\u6cd5\u652f\u6301\uff0c\u4f1a\u89e6\u53d1\u5931\u8d25\u56de\u8c03\u3002<\/p>\n<h2><span><\/span>\u65b9\u6cd5\u53c2\u6570<\/h2>\n<p>Object object<\/p>\n<h3><span><\/span>object \u53c2\u6570\u8bf4\u660e<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u5c5e\u6027\u540d<\/th>\n<th>\u7c7b\u578b<\/th>\n<th>\u5fc5\u586b<\/th>\n<th>\u9ed8\u8ba4\u503c<\/th>\n<th>\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\n<p>success<\/p>\n<\/td>\n<td>\n<p>Function<\/p>\n<\/td>\n<td>\n<p>\u5426<\/p>\n<\/td>\n<td><\/td>\n<td>\n<p>\u63a5\u53e3\u8c03\u7528\u6210\u529f\u7684\u56de\u8c03\u51fd\u6570<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>fail<\/p>\n<\/td>\n<td>\n<p>Function<\/p>\n<\/td>\n<td>\n<p>\u5426<\/p>\n<\/td>\n<td><\/td>\n<td>\n<p>\u63a5\u53e3\u8c03\u7528\u5931\u8d25\u7684\u56de\u8c03\u51fd\u6570<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>complete<\/p>\n<\/td>\n<td>\n<p>Function<\/p>\n<\/td>\n<td>\n<p>\u5426<\/p>\n<\/td>\n<td><\/td>\n<td>\n<p>\u63a5\u53e3\u8c03\u7528\u7ed3\u675f\u65f6\u7684\u56de\u8c03\u51fd\u6570\uff08\u8c03\u7528\u6210\u529f\u3001\u8c03\u7528\u5931\u8d25\u90fd\u4f1a\u6267\u884c\uff09<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>needFullAccuracy<\/p>\n<\/td>\n<td>\n<p>Boolean<\/p>\n<\/td>\n<td>\n<p>\u5426<\/p>\n<\/td>\n<td>\n<p>false<\/p>\n<\/td>\n<td>\n<p>\u9488\u5bf9 iOS14 \u4ee5\u4e0a\u7684\u65b0\u7279\u6027\uff0c\u5176\u4ed6\u60c5\u51b5\u672c\u53c2\u6570\u5ffd\u7565\u3002\u9ed8\u8ba4\u60c5\u51b5\u5bbf\u4e3b\u662f\u7cbe\u786e\u5b9a\u4f4d\u5c31\u8fd4\u56de\u7cbe\u786e\u5b9a\u4f4d\u4fe1\u606f\u3002\u4f20\u5165 true \u4f1a\u5f3a\u5236\u4f7f\u7528\u7cbe\u786e\u5b9a\u4f4d\u4fe1\u606f\uff0ciOS14 \u4ee5\u4e0a\u5982\u679c\u6ca1\u6709\u7cbe\u786e\u5b9a\u4f4d\u6743\u9650\uff0c\u4f1a\u5f39\u51fa\u7cbe\u786e\u5b9a\u4f4d\u6388\u6743\u5f39\u6846<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><span><\/span>\u793a\u4f8b<\/h2>\n<p>\u8df3\u8f6c\u7f16\u8f91\u5de5\u5177<\/p>\n<p>\u5728\u5f00\u53d1\u8005\u5de5\u5177\u4e2d\u6253\u5f00<\/p>\n<p>\u5728 WEB IDE \u4e2d\u6253\u5f00<\/p>\n<p>\u626b\u7801\u4f53\u9a8c<\/p>\n<p>\u4ee3\u7801\u793a\u4f8b<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/static.sitestack.cn\/projects\/smartprogram-20210306\/97ebf63311ffac886baad1c970c1b97b.png\" class=\"aligncenter\"><\/p>\n<p>\u8bf7\u4f7f\u7528\u767e\u5ea6APP\u626b\u7801<\/p>\n<h3><span><\/span>\u56fe\u7247\u793a\u4f8b<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/static.sitestack.cn\/projects\/smartprogram-20210306\/977feb8e6e7bb1ac669beb3250ed8a51.gif\" class=\"aligncenter\"><\/p>\n<\/p>\n<h3><span><\/span>\u4ee3\u7801\u793a\u4f8b<\/h3>\n<ul>\n<li>JS<\/li>\n<\/ul>\n<pre>\n \n \n <ol>\n  \n  \n  <li><code><span>Page<\/span><span>({<\/span><\/code><\/li>\n  \n  \n  <li><code><span> startLocationUpdate<\/span><span>()<\/span><span> <\/span><span>{<\/span><\/code><\/li>\n  \n  \n  <li><code><span> swan<\/span><span>.<\/span><span>startLocationUpdate<\/span><span>({<\/span><\/code><\/li>\n  \n  \n  <li><code><span> success<\/span><span>:<\/span><span> res <\/span><span>=&gt;<\/span><span> console<\/span><span>.<\/span><span>log<\/span><span>(<\/span><span>'\u5f00\u542f\u5c0f\u7a0b\u5e8f\u63a5\u6536\u4f4d\u7f6e\u6d88\u606f\u6210\u529f'<\/span><span>),<\/span><\/code><\/li>\n  \n  \n  <li><code><span> fail<\/span><span>:<\/span><span> err <\/span><span>=&gt;<\/span><span> console<\/span><span>.<\/span><span>error<\/span><span>(<\/span><span>'\u5f00\u542f\u5c0f\u7a0b\u5e8f\u63a5\u6536\u4f4d\u7f6e\u6d88\u606f\u5931\u8d25\uff1a'<\/span><span>,<\/span><span> err<\/span><span>),<\/span><\/code><\/li>\n  \n  \n  <li><code><span> complete<\/span><span>:<\/span><span> msg <\/span><span>=&gt;<\/span><span> console<\/span><span>.<\/span><span>log<\/span><span>(<\/span><span>'\u8c03\u7528\u5f00\u542f\u5c0f\u7a0b\u5e8f\u63a5\u6536\u4f4d\u7f6e\u6d88\u606fAPI\u5b8c\u6210'<\/span><span>)<\/span><\/code><\/li>\n  \n  \n  <li><code><span> <\/span><span>});<\/span><\/code><\/li>\n  \n  \n  <li><code><span> <\/span><span>}<\/span><\/code><\/li>\n  \n  \n  <li><code><span>})<\/span><\/code><\/li>\n \n \n <\/ol><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>swan.startLocationUpdate \u65b9\u6cd5\u53c2\u6570 object \u53c2\u6570\u8bf4\u660e \u793a\u4f8b \u56fe\u7247\u793a\u4f8b \u4ee3\u7801\u793a\u4f8b  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":186533,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[182398],"tags":[],"class_list":["post-186532","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mini-program"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/186532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=186532"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/186532\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media\/186533"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=186532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=186532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=186532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}