{"id":13978,"date":"2023-12-28T18:33:03","date_gmt":"2023-12-28T10:33:03","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=13978"},"modified":"2023-12-28T18:33:03","modified_gmt":"2023-12-28T10:33:03","slug":"%e6%89%8b%e6%9c%ba%e7%bd%91%e7%ab%99%e6%80%8e%e4%b9%88%e7%94%9f%e6%88%90%e5%81%87app%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/13978\/","title":{"rendered":"\u624b\u673a\u7f51\u7ad9\u600e\u4e48\u751f\u6210\u5047app\uff1f"},"content":{"rendered":"

\u751f\u6210\u5047APP\u7684\u8fc7\u7a0b\u4e3b\u8981\u662f\u5c06\u4e00\u4e2a\u624b\u673a\u7f51\u7ad9\uff08\u901a\u5e38\u79f0\u4e3aWeb App\u6216PWA\uff0cProgressive Web App\uff09\u5c01\u88c5\u6210\u4e00\u4e2a\u539f\u751f\u5e94\u7528(APP)\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u5e76\u4e0d\u6d89\u53ca\u5b9e\u9645\u7684\u539f\u751f\u5e94\u7528\u5f00\u53d1\uff0c\u800c\u662f\u901a\u8fc7\u4e00\u4e9b\u6865\u63a5\u6280\u672f\u6216WebView\u6765\u5b9e\u73b0\u3002\u5c01\u88c5\u597d\u7684\u5047APP\u53ef\u4ee5\u65b9\u4fbf\u5730\u5728\u79fb\u52a8\u8bbe\u5907\u4e0a\u7f51\u7ad9app\u751f\u6210\u5668\u8f6f\u4ef6<\/a>\u5b89\u88c5\u3001\u8fd0\u884c\uff0c\u5c31\u50cf\u4e00\u4e2a\u771f\u6b63\u7684\u539f\u751f\u5e94\u7528\u4e00\u6837\u3002\u4e0b\u9762\u8be6\u7ec6\u4ecb\u7ecd\u4e00\u4e0b\u751f\u6210\u5047APP\u7684\u8fc7\u7a0b\u4e0e\u539f\u7406\uff1a<\/p>\n

1. \u51c6\u5907\u5de5\u4f5c\uff1a\u9996\u5148\uff0c\u4f60\u9700\u8981\u6709\u4e00\u4e2a\u5df2\u7ecf\u5f00\u53d1\u5b8c\u6bd5\u7684\u624b\u673a\u7f51\u7ad9\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528HTML\u3001CSS\u548cJavaScript\u6765\u6784\u5efa\u4e00\u4e2a\u54cd\u5e94\u5f0f\u7f51\u7ad9\uff0c\u9002\u5e94\u4e0d\u540c\u5c3a\u5bf8\u7684\u5c4f\u5e55\u3002\u624b\u673a\u7f51\u7ad9\u51c6\u5907\u597d\u4e4b\u540e\uff0c\u4e0b\u4e00\u6b65\u5c31\u662f\u5c06\u8fd9\u4e2a\u7f51\u7ad9\u8f6c\u6362\u6210\u4e00\u4e2a\u5047APP\u3002<\/p>\n

2. \u5c01\u88c5\u6280\u672f\uff1a\u6709\u591a\u79cd\u6280\u672f\u53ef\u4ee5\u600e\u4e48\u8c03\u7528\u6dd8\u5b9d\u7f51\u9875\u751f\u6210\u81ea\u5df1\u7684app<\/a>\u5b9e\u73b0\u5c06\u624b\u673a\u7f51\u7ad9\u5c01\u88c5\u6210\u4e00\u4e2a\u5047APP\uff0c\u4e3b\u8981\u6709WebView\u65b9\u6cd5\u548cPWA\u65b9\u6cd5\u3002\u4ee5\u4e0b\u5206\u522b\u4ecb\u7ecd\u8fd9\u4e24\u79cd\u65b9\u6cd5\uff1a<\/p>\n

(1) WebView\u65b9\u6cd5\uff1a<\/p>\n

WebView\u662f\u4e00\u4e2a\u663e\u793a\u7f51\u9875\u7684\u7ec4\u4ef6\uff0c\u53ef\u4ee5\u5c06\u7f51\u9875\u5d4c\u5165\u5230\u539f\u751f\u5e94\u7528\u4e2d\u3002\u901a\u8fc7WebView\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u53ea\u5305\u542bWebView\u7684\u539f\u751f\u5e94\u7528\uff0c\u7136\u540e\u8ba9WebView\u52a0\u8f7d\u4f60\u7684\u624b\u673a\u7f51\u7ad9\u3002\u8fd9\u6837\uff0c\u7528\u6237\u5728\u4f7f\u7528\u5047APP\u65f6\u5b9e\u9645\u4e0a\u5c31\u662f\u5728\u6d4f\u89c8\u7f51\u7ad9\u3002<\/p>\n

\u4f7f\u7528WebView\u65b9\u6cd5\u7684\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n

1) \u9009\u62e9\u5408\u9002\u7684\u5f00\u53d1\u5de5\u5177\u3002\u5982\uff1aApache Cordova\uff08\u4e4b\u524d\u53ebPhoneGap\uff09\u6216React Native\u3002<\/p>\n

2) \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u9879\u76ee\uff0c\u5e76\u8bbe\u7f6e\u57fa\u672c\u7684\u5c5e\u6027\u3002<\/p>\n

3) \u5c06\u4f60\u7684\u624b\u673a\u7f51\u7ad9URL\u6dfb\u52a0\u5230WebView\u3002<\/p>\n

4) \u8bbe\u7f6eAPP\u56fe\u6807\u3001\u542f\u52a8\u753b\u9762\u7b49\u3002<\/p>\n

5) \u7f16\u8bd1\u548c\u6253\u5305\u6210\u5bf9\u5e94\u5e73\u53f0\uff08\u5982Androi<\/p>\n

<\/figure>\n<\/p>\n

d\u6216iOS\uff09\u7684\u5b89\u88c5\u6587\u4ef6\u3002<\/p>\n

(2) PWA\u65b9\u6cd5\uff1a<\/p>\n

PWA\uff08Progressive Web App\uff09\u662f\u4e00\u79cd\u53ef\u4ee5\u79bb\u7ebf\u8fd0\u884c\u3001\u7ed9\u7528\u6237\u539f\u751f\u5e94\u7528\u822c\u4f53\u9a8c\u7684Web\u5e94\u7528\u3002PWA\u53ef\u4ee5\u88ab\u6dfb\u52a0\u5230\u4e3b\u5c4f\uff0c\u62e5\u6709\u72ec\u7acb\u7684\u56fe\u6807\u548c\u542f\u52a8\u753b\u9762\u3002\u4e0d\u540c\u4e8eWebView\uff0cPWA\u9700\u8981\u5728\u7f51\u7ad9\u672c\u8eab\u6dfb\u52a0\u4e00\u4e9b\u4ee3\u7801\u6765\u5b9e\u73b0\u8fd9\u4e9b\u529f\u80fd\u3002<\/p>\n

\u4f7f\u7528PWA\u65b9\u6cd5\u7684\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n

1) \u5728\u4f60\u7684\u7f51\u7ad9\u6839\u76ee\u5f55\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a\u201cmanifest.json\u201d\u7684\u6587\u4ef6\uff0c\u7528\u6765\u63cf\u8ff0\u4f60\u7684PWA\u5e94\u7528\uff0c\u5305\u62ec\u540d\u79f0\u3001\u56fe\u6807\u3001\u4e3b\u9898\u989c\u8272\u7b49\u3002<\/p>\n

2) \u5728\u7f51\u7ad9\u7684\u5934\u90e8\u5f15\u5165\u201cmanifest.json\u201d\u6587\u4ef6\u3002<\/p>\n

3) \u521b\u5efa\u4e00\u4e2a\u540d\u4e3a\u201cservice-worker.js\u201d\u7684\u6587\u4ef6\uff0c\u7528\u6765\u7ba1\u7406\u79bb\u7ebf\u7f13\u5b58\u7b49\u529f\u80fd\u3002<\/p>\n

4) \u5728\u7f51\u7ad9\u7684\u4e3b\u8981\u5165\u53e3\u6587\u4ef6\uff08\u901a\u5e38\u662findex.html\uff09\u6ce8\u518cservice worker\u3002<\/p>\n

5) \u4f7f\u7528\u7f51\u7ad9\u6d4b\u8bd5\u5de5\u5177\uff08\u5982Lighthouse\uff09\u68c0\u6d4b\u4f60\u7684\u7f51\u7ad9\u662f\u5426\u6ee1\u8db3PWA\u6807\u51c6\u3002<\/p>\n

6) \u7528\u6237\u8bbf\u95ee\u4f60\u7684\u7f51\u7ad9\u65f6\uff0c\u79fb\u52a8\u8bbe\u5907\u4f1a\u63d0\u793a\u7528\u6237\u6dfb\u52a0\u8be5PWA\u5230\u4e3b\u5c4f\u3002<\/p>\n

\u65e0\u8bba\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\u751f\u6210\u5047APP\uff0c\u539f\u7406\u90fd\u662f\u57fa\u4e8e\u624b\u673a\u7f51\u7ad9\u7684\u3002\u751f\u6210\u7684\u5047APP\u867d\u7136\u5177\u5907\u7c7b\u4f3c\u539f\u751f\u5e94\u7528\u7684\u5916\u89c2\u548c\u529f\u80fd\uff0c\u4f46\u53ef\u80fd\u65e0\u6cd5\u5b9e\u73b0\u4e00\u4e9b\u9ad8\u7ea7\u7684\u539f\u751f\u529f\u80fd\uff0c\u5982\u6df1\u5ea6\u786c\u4ef6\u8bbf\u95ee\u7b49\u3002\u5bf9\u4e8e\u4e00\u822c\u9700\u6c42\uff0c\u8fd9\u79cd\u5047APP\u4ecd\u53ef\u4ee5\u5e26\u6765\u8f83\u597d\u7684\u7528\u6237\u4f53\u9a8c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u751f\u6210\u5047APP\u7684\u8fc7\u7a0b\u4e3b\u8981\u662f\u5c06\u4e00\u4e2a\u624b\u673a\u7f51\u7ad9\uff08\u901a\u5e38\u79f0\u4e3aWeb App\u6216PWA\uff0cProgressive Web App\uff09\u5c01\u88c5\u6210\u4e00\u4e2a\u539f\u751f\u5e94\u7528(APP)\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u5e76\u4e0d\u6d89\u53ca\u5b9e\u9645\u7684\u539f\u751f\u5e94\u7528\u5f00\u53d1\uff0c\u800c\u662f\u901a\u8fc7\u4e00\u4e9b\u6865\u63a5\u6280\u672f<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[18455,6129,2271,247,18456],"topic":[],"class_list":["post-13978","post","type-post","status-publish","format-standard","hentry","category-appkf","tag-html5app","tag-6129","tag-2271","tag-247","tag-app"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/13978","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=13978"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/13978\/revisions"}],"predecessor-version":[{"id":14007,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/13978\/revisions\/14007"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=13978"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=13978"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=13978"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=13978"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}