{"id":9073,"date":"2023-11-21T18:34:17","date_gmt":"2023-11-21T10:34:17","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=9073"},"modified":"2023-11-21T18:34:17","modified_gmt":"2023-11-21T10:34:17","slug":"%e5%b0%86%e4%b8%80%e4%b8%aa%e7%bd%91%e9%a1%b5%e7%94%9f%e6%88%90app%e6%80%8e%e4%b9%88%e5%ae%9e%e7%8e%b0%e7%9a%84%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/9073\/","title":{"rendered":"\u5c06\u4e00\u4e2a\u7f51\u9875\u751f\u6210app\u600e\u4e48\u5b9e\u73b0\u7684\uff1f"},"content":{"rendered":"
\u5c06\u4e00\u4e2a\u7f51\u9875\u751f\u6210APP\uff08\u539f\u7406\u53ca\u8be6\u7ec6\u4ecb\u7ecd\uff09<\/p>\n
\u5c06\u4e00\u4e2a\u7f51\u9875\u8f6c\u6362\u6210APP\uff0c\u6838\u5fc3\u601d\u60f3\u662f\u4f7f\u7528cms\u7f51\u7ad9\u80fd\u4e0d\u80fd\u751f\u6210app<\/a>Webview\u7ec4\u4ef6\u6765\u52a0\u8f7d\u5e76\u663e\u793a\u7f51\u9875\u5185\u5bb9\u3002WebView\u662f\u4e00\u79cd\u5728\u539f\u751f\u5e94\u7528\u4e2d\u5d4c\u5165\u7f51\u9875\u7684\u6280\u672f\uff0c\u5141\u8bb8\u4f60\u5728APP\u5185\u90e8\u5c55\u793aHTML\u53ca\u76f8\u5173\u6280\u672f\u521b\u5efa\u7684\u5185\u5bb9\uff0c\u4f8b\u5982CSS\u3001JavaScript\u7b49\uff0c\u8fd9\u79cd\u8f6c\u6362\u65b9\u5f0f\u88ab\u79f0\u4e3a\u201c\u6df7\u5408\u5f0f\u5e94\u7528\u201d\u6216\u201c\u6df7\u5408\u5f00\u53d1\u201d\u3002<\/p>\n \u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5c06\u7f51\u9875\u8f6c\u6362\u6210APP\u7684\u539f\u7406\u548c\u5b9e\u73b0\u65b9\u6cd5\u3002<\/p>\n \u4e00\u3001\u539f\u7406<\/p>\n 1. WebView\u7ec4\u4ef6<\/p>\n WebView\u662f\u5927\u591a\u6570\u79fb\u52a8\u64cd\u4f5c\u7cfb\u7edf\uff08\u5982Android\u548ciOS\uff09\u63d0\u4f9b\u7684\u4e00\u4e2a\u7ec4\u4ef6\uff0c\u5b83\u5141\u8bb8\u539f\u751fAPP\u5185\u90e8\u52a0\u8f7d\u548c\u663e\u793a\u7f51\u9875\u3002\u4f7f\u7528WebView\uff0c\u4f60\u53ef\u4ee5\u5c06\u4e00\u4e2a\u7f51\u9875\u4f5c\u4e3a\u539f\u751fAPP\u7684\u4e00\u90e8\u5206\uff0c\u65e0\u9700\u6253\u5f00\u5916\u90e8\u6d4f\u89c8\u5668\u3002\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0cAPP\u672c\u8d28\u4e0a\u662f\u4e00\u4e2a\u5305\u88c5\u5668\uff0c\u5b83\u201c\u5c01\u88c5\u201d\u4e86\u7f51\u9875\u548c\u4e0e\u539f\u751f\u8bbe\u5907\u4ea4\u4e92\u7684API\uff0c\u8ba9\u7528\u6237\u80fd\u591f\u62e5\u6709\u7c7b\u4f3c\u539f\u751f\u5e94\u7528\u7684\u4f53\u9a8c\u3002<\/p>\n 2. \u6df7\u5408\u5e94\u7528<\/p>\n \u5229\u7528WebView\u6280\u672f\uff0c\u53ef\u4ee5\u521b\u5efa\u6df7\u5408\u5e94\u7528\u3002\u8fd9\u4e9b\u5e94\u7528\u540c\u65f6\u5305\u542b\u539f\u751f\u4ee3\u7801\uff08\u5982Java\u3001Kotlin\u3001Swift\u6216Objective-C\uff09\u548cWeb\u6280\u672f\uff08\u5982HTML\u3001CSS\u3001JavaScript\uff09\u3002\u6df7\u5408\u5e94\u7528\u4ee5\u539f\u751f\u5e94\u7528\u7684\u5f62\u5f0f\u5206\u53d1\uff0c\u5e76\u5141\u8bb8\u4e00\u5b9a\u7a0b\u5ea6\u7684\u79bb\u7ebf\u4f7f\u7528\u3002\u8fd9\u610f\u5473\u7740\u5b83\u4eec\u53ef\u4ee5\u5728\u5e94\u7528\u5546\u5e97\u53d1\u5e03\uff0c\u5e76\u901a\u8fc7\u5185\u7f6eAPI\u4e0e\u8bbe\u5907\u7684\u539f\u751f\u529f\u80fd\uff08\u5982\u76f8\u673a\u3001\u5730\u7406\u4f4d\u7f6e\u3001\u901a\u77e5\u7b49\uff09\u8fdb\u884c\u4ea4\u4e92\u3002<\/p>\n \u4e8c\u3001\u5b9e\u73b0\u65b9\u6cd5<\/p>\n 1. \u4f7f\u7528Webview<\/p>\n \u6839\u636e\u4f7f\u7528\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u9009\u62e9\u76f8\u5e94\u7684\u6280\u672f\u5b9e\u73b0\u3002<\/p>\n – Android\uff1a\u4f7f\u7528Android\u7684 WebView\u7ec4\u4ef6\u3002<\/p>\n – iOS\uff1a\u4f7f\u7528 iOS\u7684 WKWebView\u7ec4\u4ef6\u3002<\/p>\n 2. \u5f00\u53d1\u6846\u67b6<\/p>\n \u4e3a\u7b80\u5316\u5f00\u53d1\u6d41\u7a0b\uff0c\u4f60\u53ef\u4ee5\u9009\u62e9\u4ee5\u4e0b\u6d41\u884c\u7684\u5f00\u53d1\u6846\u67b6\uff0c\u8fd9\u4e9b\u6846\u67b6\u5141\u8bb8\u4f60\u4e00\u6b21\u6027\u7f16\u5199\u4ee3\u7801\uff0c\u7136\u540e\u5c06\u5176\u8f6c\u6362\u4e3a\u53ef\u8fd0\u884c\u5728\u591a\u4e2a\u5e73\u53f0\uff08\u5982Android\u3001iOS\u3001Windows\uff09\u7684APP\u3002<\/p>\n – Apache Cordova\uff1a\u8fd9\u662f\u4e00\u4e2a\u8de8\u5e73\u53f0\u79fb\u52a8\u5e94\u7528\u5f00\u53d1\u6846\u67b6\uff0c\u4f7f\u7528Web\u6280\u672f\u5f00\u53d1\u6df7\u5408\u5f0f\u79fb\u52a8\u5e94\u7528\u3002<\/p>\n – React Native\uff1a\u8fd9\u662f\u4e00\u4e2a\u57fa\u4e8eJavaScript\u7684\u6846\u67b6\uff0c\u4f7f\u7528React.js\u5e93\u4e3a\u57fa\u7840\uff0c\u5141\u8bb8\u5f00\u53d1\u8005\u7f16\u5199\u63a5\u8fd1\u539f\u751f\u6027\u80fd\u7684\u79fb\u52a8\u5e94\u7528\u3002<\/p>\n – Flutter\uff1a\u8fd9\u662f\u4e00\u4e2a\u7531\u8c37\u6b4c\u5f00\u53d1\u7684UI\u5de5\u5177\u5305\uff0c\u4f7f\u7528Dart\u8bed\u8a00\u7f16\u5199\uff0c\u5141\u8bb8<\/p>\n \u4ece\u5355\u4e00\u4ee3\u7801\u5e93\u521b\u5efa\u591a\u5e73\u53f0APP\u3002<\/p>\n \u4e09\u3001\u64cd\u4f5c\u6b65\u9aa4<\/p>\n \u4ee5\u4e0b\u4e3a\u5c06\u7f51\u9875\u8f6c\u6362\u6210APP\u7684\u7b80\u5355\u6b65\u9aa4\uff1a<\/p>\n 1. \u9009\u62e9\u5408\u9002\u7684\u5f00\u53d1\u6846\u67b6\u3002<\/p>\n 2. \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u9879\u76ee\u3002<\/p>\n 3. \u5728\u9879\u76ee\u4e2d\u6dfb\u52a0WebView\u7ec4\u4ef6\u3002<\/p>\n 4. \u8bbe\u7f6eWebView\u7684URL\u4e3a\u4f60\u60f3\u8981\u52a0\u8f7d\u7684\u7f51\u9875\u5730\u5740\u3002<\/p>\n 5. \u914d\u7f6eWebView\u5c5e\u6027\uff0c\u5982\u662f\u5426\u652f\u6301\u7f29\u653e\u3001\u6eda\u52a8\u7b49\u3002<\/p>\n 6. \uff08\u53ef\u9009\uff09\u6dfb\u52a0\u4e0e\u539f\u751f\u529f\u80fd\u4ea4\u4e92\u7684JavaScript\u63a5\u53e3\u3002<\/p>\n 7. \u7f16\u8bd1\u9879\u76ee\u5e76\u751f\u6210APP\u6587\u4ef6\u3002<\/p>\n \u603b\u7ed3<\/p>\n \u5c06\u7f51\u9875\u751f\u6210APP\u7684\u8fc7\u7a0b\u5b9e\u9645\u4e0a\u662f\u901a\u8fc7WebView\u7ec4\u4ef6\u52a0\u8f7d\u7f51\u9875\u5185\u5bb9\u5e76\u5c01\u88c5\u5728\u539f\u751f\u5e94\u7528\u4e2d\u3002\u53ef\u4ee5\u6839\u636e\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5f00\u53d1\u6846\u67b6\uff0c\u7f16\u5199\u4ee3\u7801\u5e76\u751f\u6210\u53ef\u591a\u5e73\u53f0\u8fd0\u7f51\u7ad9\u76f4\u63a5app\u751f\u6210<\/a>\u884c\u7684APP\u3002\u8fd9\u79cd\u65b9\u6cd5\u5177\u6709\u8f83\u4f4e\u7684\u5f00\u53d1\u590d\u6742\u6027\uff0c\u80fd\u4e3a\u5f00\u53d1\u8005\u8282\u7701\u65f6\u95f4\u548c\u7cbe\u529b\uff0c\u540c\u65f6\u8ba9\u7528\u6237\u5728\u4f7f\u7528\u65f6\u80fd\u83b7\u5f97\u8f83\u597d\u7684\u4f53\u9a8c\u3002\u7136\u800c\uff0c\u5bf9\u4e8e\u9ad8\u6027\u80fd\u9700\u6c42\u6216\u590d\u6742\u4ea4\u4e92\u7684APP\uff0c\u4ecd\u5efa\u8bae\u4f7f\u7528\u539f\u751f\u5f00\u53d1\u65b9\u5f0f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" \u5c06\u4e00\u4e2a\u7f51\u9875\u751f\u6210APP\uff08\u539f\u7406\u53ca\u8be6\u7ec6\u4ecb\u7ecd\uff09\u5c06\u4e00\u4e2a\u7f51\u9875\u8f6c\u6362\u6210APP\uff0c\u6838\u5fc3\u601d\u60f3\u662f\u4f7f\u7528Webview\u7ec4\u4ef6\u6765\u52a0\u8f7d\u5e76\u663e\u793a\u7f51\u9875\u5185\u5bb9\u3002WebView\u662f\u4e00\u79cd\u5728\u539f\u751f\u5e94\u7528\u4e2d\u5d4c\u5165\u7f51\u9875\u7684\u6280\u672f\uff0c\u5141\u8bb8\u4f60\u5728APP\u5185\u90e8\u5c55\u793aHTML\u53ca\u76f8<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[10429,15430,384,736,149],"topic":[],"class_list":{"0":"post-9073","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-appkf","7":"tag-app","9":"tag-384","10":"tag-736","11":"tag-149"},"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/9073","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\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=9073"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/9073\/revisions"}],"predecessor-version":[{"id":9222,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/9073\/revisions\/9222"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=9073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=9073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=9073"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=9073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<\/figure>\n<\/p>\n