{"id":3804,"date":"2023-04-28T11:02:22","date_gmt":"2023-04-28T03:02:22","guid":{"rendered":"https:\/\/app.applebyme.cn\/cloud\/?p=3804"},"modified":"2023-04-28T11:02:22","modified_gmt":"2023-04-28T03:02:22","slug":"%e8%8b%b9%e6%9e%9capp%e4%b8%8a%e6%9e%b6h5%e6%89%93%e5%8c%85app%e5%a5%bd%e4%b8%8a%e6%9e%b6%e5%98%9b%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/app.applebyme.cn\/cloud\/appshangjia\/3804.html","title":{"rendered":"\u82f9\u679capp\u4e0a\u67b6h5\u6253\u5305APP\u597d\u4e0a\u67b6\u561b\uff1f"},"content":{"rendered":"<p>\u5728\u82f9\u679cApp Store\u4e0a\u67b6H5\u9875\u9762\uff0c\u9700\u8981\u4e86\u89e3\u4ee5\u4e0b\u51e0\u70b9\uff1a<\/p>\n<p><a href=\"https:\/\/appshangjia.yimenapp.com\/shangjia-5245.html\">app\u4e0a\u67b6\u6ca1\u6709\u6ce8\u9500\u529f\u80fd<\/a>1. H5\u9875\u9762\u7684\u6982\u5ff5<\/p>\n<p>H5\u9875\u9762\u662f\u6307HTML5\u9875\u9762\uff0c\u662f\u4e00\u79cd\u6807\u51c6\u5316\u7684\u7f51\u9875\u8bbe\u8ba1\u8bed\u8a00\u3002\u5b83\u53ef\u4ee5\u5728\u4e0d\u540c\u7684\u8bbe\u5907\u4e0a\u5c55\u793a\uff0c\u5305\u62ec\u624b\u673a\u3001\u5e73\u677f\u7535\u8111\u548c\u7535\u8111\u7b49\uff0c\u800c\u4e14\u53ef\u4ee5\u4e0e\u8bbe\u5907\u7684\u786c\u4ef6\u8fdb\u884c\u4ea4\u4e92\uff0c\u6bd4\u5982\u6444\u50cf\u5934\u3001\u5730\u7406\u4f4d\u7f6e\u548c\u84dd\u7259\u7b49\u3002<\/p>\n<p>2. \u5728\u82f9\u679cApp Store\u4e0a\u67b6H5\u9875\u9762\u7684\u539f\u7406<\/p>\n<p>\u5728\u82f9\u679cApp Store\u4e0a\u67b6H5\u9875\u9762\uff0c\u9700\u8981\u501f\u52a9\u4e00\u4e2a\u53eb\u505aWebView\u7684\u7ec4\u4ef6\u3002WebView\u662f\u4e00\u4e2a\u53ef\u4ee5\u663e\u793a\u7f51\u9875\u5185\u5bb9\u7684\u63a7\u4ef6\uff0c\u5b83\u53ef\u4ee5\u5728\u5e94\u7528\u7a0b\u5e8f\u4e2d\u5d4c\u5165\u7f51\u9875\uff0c\u8ba9\u7528\u6237\u53ef\u4ee5\u5728\u5e94\u7528\u7a0b\u5e8f\u4e2d\u8bbf\u95ee\u7f51\u9875\u5185\u5bb9\u3002<\/p>\n<p>\u5177\u4f53\u6765\u8bf4\uff0c\u9700\u8981\u5728\u5e94\u7528\u7a0b\u5e8f\u4e2d\u6dfb\u52a0\u4e00\u4e2aWebView\u63a7\u4ef6\uff0c\u5e76\u5c06H5\u9875\u9762\u7684URL\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u7ed9WebView\u63a7\u4ef6\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u5728\u5e94\u7528\u7a0b\u5e8f\u4e2d\u5c55\u793aH5\u9875\u9762\u4e86\u3002<\/p>\n<p>3. \u5728\u82f9\u679cApp Store\u4e0a\u67b6H5\u9875\u9762\u7684\u6b65\u9aa4<\/p>\n<p>\u6b65\u9aa4\u4e00\uff1a\u51c6\u5907\u5de5\u4f5c<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.cdn.yimenapp.com\/2023-03\/31\/11\/30373513214.jpg\" \/><\/figure>\n<\/p>\n<p>\u9996\u5148\u9700\u8981\u51c6\u5907\u597dH5\u9875\u9762\u7684URL\uff0c\u53ef\u4ee5\u4f7f\u7528\u5728\u7ebf\u5de5\u5177\u6216\u8005\u81ea\u5df1\u7f16\u5199HTML\u4ee3\u7801\u6765\u521b\u5efaH5\u9875\u9762\u3002\u53e6\u5916\uff0c\u8fd8\u9700\u8981\u6709\u4e00\u4e2a\u82f9\u679c\u5f00\u53d1\u8005\u8d26\u53f7\uff0c\u4ee5\u53caXcode\u5f00\u53d1\u5de5\u5177\u3002<\/p>\n<p>\u6b65\u9aa4\u4e8c\uff1a\u521b\u5efaXcode\u9879\u76ee<\/p>\n<p>\u6253\u5f00Xcode\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u9879\u76ee\u3002\u9009\u62e9\u201cSingle View App\u201d\u6a21\u677f\uff0c\u586b\u5199\u9879\u76ee\u540d\u79f0\u3001\u7ec4\u7ec7\u540d\u79f0\u548cBundle Identifier\u7b49\u4fe1\u606f\u3002<\/p>\n<p>\u6b65\u9aa4\u4e09\uff1a\u6dfb\u52a0WebView\u63a7\u4ef6<\/p>\n<p>\u5728Main.storyboard\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4e00\u4e2aWebView\u63a7\u4ef6\uff0c\u5e76\u8bbe\u7f6e\u5176\u5927\u5c0f\u548c\u4f4d\u7f6e\u3002<\/p>\n<p>\u6b65\u9aa4\u56db\uff1a\u52a0\u8f7dH5\u9875\u9762<\/p>\n<p>\u5728ViewController.swift\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff0c\u7528\u4e8e\u52a0\u8f7dH5\u9875\u9762\uff1a<\/p>\n<p>&#8220;`swift<\/p>\n<p>import UIKit<\/p>\n<p>import WebKit<\/p>\n<p>class ViewController: UIViewController, WKNavigationDelegate {<\/p>\n<p>    var webView: WKWebView!<\/p>\n<p>    override func viewDidLoad() {<\/p>\n<p>        super.viewDidLoad()<\/p>\n<p>        webView = WKWebView()<\/p>\n<p>        webView.navigationDelegate = self<\/p>\n<p>        view = webView<\/p>\n<p>        let url = URL(string: &#8220;https:\/\/www.example.com&#8221;)!<\/p>\n<p>        webView.load(URLRequest(url: url))<\/p>\n<p>        webView.allowsBackForwardNavigationGestures = true<\/p>\n<p>    }<\/p>\n<p>    func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {<\/p>\n<p>        title = webView.title<\/p>\n<p>    }<\/p>\n<p>}<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0cURL(string: &#8220;https:\/\/www.example.com&#8221;)!\u9700\u8981\u66ff\u6362\u6210\u81ea\u5df1\u7684H5\u9875\u9762\u7684URL\u3002<\/p>\n<p>\u6b65\u9aa4\u4e94\uff1a\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f<\/p>\n<p>\u5728Xcode\u4e2d\u70b9\u51fb\u201cRun\u201d\u6309\u94ae\uff0c\u5c06\u5e94\u7528\u7a0b\u5e8f\u8fd0\u884c\u5728\u6a21\u62df\u5668\u6216\u8005\u771f\u673a\u4e0a\uff0c\u5c31\u53ef\u4ee5\u770b\u5230\u5c55\u793aH5\u9875\u9762\u7684\u6548\u679c\u4e86\u3002<\/p>\n<p>4. \u603b\u7ed3<\/p>\n<p>\u5728\u82f9\u679cApp Store\u4e0a\u67b6H5\u9875\u9762\uff0c\u9700\u8981\u4f7f\u7528WebView\u63a7\u4ef6\u6765\u5c55\u793aH5\u9875\u9762\u3002\u9700\u8981\u5728Xcode\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u9879\u76ee\uff0c\u6dfb\u52a0WebView\u63a7\u4ef6\uff0c\u5e76\u52a0\u8f7dH5\u9875\u9762\u7684URL\u3002\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u5c31<a href=\"https:\/\/appshangjia.yimenapp.com\/shangjia-4064.html\">\u5f00\u53d1app\u4e0a\u67b6\u5e94\u7528\u5e02\u573a\u9700\u8981\u4ec0\u4e48\u6761\u4ef6<\/a>\u53ef\u4ee5\u5c06H5\u9875\u9762\u5d4c\u5165\u5230\u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0c\u5e76\u5728App Store\u4e0a\u67b6\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u82f9\u679cApp Store\u4e0a\u67b6H5\u9875\u9762\uff0c\u9700\u8981\u4e86\u89e3\u4ee5\u4e0b\u51e0\u70b9\uff1a1. H5\u9875\u9762\u7684\u6982\u5ff5H5\u9875\u9762\u662f\u6307HTML5\u9875\u9762\uff0c\u662f\u4e00\u79cd\u6807\u51c6\u5316\u7684\u7f51\u9875\u8bbe\u8ba1\u8bed\u8a00\u3002\u5b83\u53ef\u4ee5\u5728\u4e0d\u540c\u7684\u8bbe\u5907\u4e0a\u5c55\u793a\uff0c\u5305\u62ec\u624b\u673a\u3001\u5e73\u677f\u7535\u8111\u548c\u7535\u8111\u7b49\uff0c\u800c\u4e14\u53ef\u4ee5\u4e0e\u8bbe<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[562,4667,4668,3005,959],"class_list":["post-3804","post","type-post","status-publish","format-standard","hentry","category-appshangjia","tag-562","tag-app","tag-ios","tag-3005","tag-959"],"_links":{"self":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/3804","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/comments?post=3804"}],"version-history":[{"count":0,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/3804\/revisions"}],"wp:attachment":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/media?parent=3804"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/categories?post=3804"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/tags?post=3804"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}