{"id":1317,"date":"2023-05-05T17:51:12","date_gmt":"2023-05-05T09:51:12","guid":{"rendered":"https:\/\/www.yimenapp.cn\/yun\/?p=1317"},"modified":"2023-05-05T17:51:12","modified_gmt":"2023-05-05T09:51:12","slug":"h5%e7%bd%91%e9%a1%b5%e6%89%93%e5%8c%85ios%e6%9c%89%e9%82%a3%e4%ba%9b%e5%a5%bd%e5%a4%84%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.yimenapp.cn\/yun\/2023\/1317\/","title":{"rendered":"h5\u7f51\u9875\u6253\u5305ios\u6709\u90a3\u4e9b\u597d\u5904\uff1f"},"content":{"rendered":"<p>H5\u7f51\u9875\u6253\u5305iOS\u6307\u7684\u662f\u5c06\u57fa\u4e8eHTML5\u6280\u672f\u5f00\u53d1\u7684\u7f51\u9875\u5e94\u7528\u6253\u5305\u6210iOS\u5e94\u7528\u7a0b\u5e8f\uff0c\u4ee5\u4fbf\u5728\u82f9\u679c\u624b\u673a\u6216\u5e73\u677f\u4e0a\u8fd0\u884c\u3002\u672c\u6587\u5c06\u4ecb\u7ecdH5\u7f51\u9875\u6253\u5305iOS\u7684\u539f\u7406\u4ee5\u53ca\u8be6\u7ec6\u6b65\u9aa4\u3002<\/p>\n<p>\u4e00\u3001\u539f\u7406<\/p>\n<p>H5\u7f51\u9875\u6253\u5305iOS\u7684\u539f\u7406\u662f\u5c06\u7f51\u9875\u5e94\u7528\u901a\u8fc7\u7279\u5b9a\u7684\u5de5\u5177\u6216\u5e73\u53f0\u8fdb\u884c\u5c01\u88c5\uff0c\u751f\u6210iOS\u5e94\u7528\u7a0b\u5e8f\u5b89\u88c5\u5305\uff08IPA\uff09\uff0c\u5e76\u901a\u8fc7\u82f9\u679c\u5f00\u53d1\u8005\u4e2d\u5fc3\u6216\u7b2c\u4e09\u65b9\u5e94\u7528\u5546\u5e97\u8fdb\u884c\u5206\u53d1\u3002\u6253\u5305\u540e\u7684iOS\u5e94\u7528\u7a0b\u5e8f<a href=\"https:\/\/appdabao.yimenapp.com\/jiage-644.html\">\u7f51\u9875\u6253\u5305apk<\/a>\u5305\u542b\u4e00\u4e2aUIWebView\u63a7\u4ef6\uff0c\u7528\u4e8e\u52a0\u8f7dH5\u7f51\u9875\u5e94\u7528\uff0c\u5e76\u63d0\u4f9b\u4e0e\u8bbe\u5907\u786c\u4ef6\u7684\u4ea4\u4e92\u80fd\u529b\u3002<\/p>\n<p>\u4e8c\u3001\u6b65\u9aa4<\/p>\n<p>H5\u7f51\u9875\u6253\u5305iOS\u7684\u5177\u4f53\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<p>1. \u51c6\u5907\u5de5\u4f5c<\/p>\n<p>\u5728\u5f00\u59cb\u6253\u5305\u4e4b\u524d\uff0c\u9700\u8981\u51c6\u5907\u4ee5\u4e0b\u5de5\u4f5c\uff1a<\/p>\n<p>\uff081\uff09\u82f9\u679c\u5f00\u53d1\u8005\u8d26\u53f7<\/p>\n<p>\uff082\uff09Xcode\u5f00\u53d1\u73af\u5883<\/p>\n<p>\uff083\uff09H5\u7f51\u9875\u5e94\u7528<\/p>\n<p>2. \u521b\u5efaXcode\u5de5\u7a0b<\/p>\n<p>\u6253\u5f00Xcode\uff0c\u9009\u62e9\u201cCreate a new Xcode project\u201d\uff0c\u9009\u62e9\u201cApplication\u201d-&gt;\u201cSingle View Application\u201d\uff0c\u586b\u5199\u5de5\u7a0b\u540d\u79f0\u3001\u7ec4\u7ec7\u540d\u79f0\u548cBundle Identifier\u3002\u5728\u201cChoose options for your new project\u201d\u4e2d\u9009\u62e9\u201cSwift\u201d\u6216\u201cObjective-C\u201d\u4f5c\u4e3a\u5f00\u53d1\u8bed\u8a00\u3002\u70b9\u51fb\u201cNext\u201d\u5e76\u9009\u62e9\u5de5\u7a0b\u4fdd\u5b58\u8def\u5f84\u3002<\/p>\n<p>3. \u5bfc\u5165H5\u7f51\u9875\u5e94\u7528<\/p>\n<p>\u5c06H5\u7f51\u9875\u5e94\u7528\u7684\u6587\u4ef6\u5939\u62d6\u62fd\u5230Xcode\u5de5\u7a0b\u4e2d\uff0c\u9009\u62e9\u201cCreate folder references\u201d\u5e76\u52fe\u9009\u201cCopy items if needed\u201d\u3002<\/p>\n<p>4. \u4fee\u6539info.plist\u6587\u4ef6<\/p>\n<p>\u5728\u201cinfo.plist\u201d\u6587\u4ef6<a href=\"https:\/\/appdabao.yimenapp.com\/jiage-2826.html\">webview\u6253\u5305<\/a>\u4e2d\u6dfb\u52a0\u201cNSAppTransportSecurity\u201d\u952e\u503c\u5bf9\uff0c\u5c06\u201cNSAllowsArbitraryLoads\u201d\u8bbe\u7f6e\u4e3a\u201cYES\u201d\uff0c\u4ee5\u5141\u8bb8\u5e94\u7528\u52a0\u8f7dHTTP\u534f\u8bae\u7684\u7f51\u9875\u3002<\/p>\n<p>5. \u4fee\u6539AppDelegate.swift\u6587\u4ef6<\/p>\n<p>\u5728\u201cAppDelegate.swift\u201d\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff0c\u4ee5\u52a0\u8f7dH5\u7f51\u9875\u5e94\u7528\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -&gt; Bool {<\/p>\n<p>    let webViewController = ViewController()<\/p>\n<p>    webViewController.url = URL(string: &#8220;http:\/\/yourwebsite.com&#8221;)<\/p>\n<p>    self.window = UIWindow(frame: UIScreen.main.bounds)<\/p>\n<p>    self.window?.rootViewController = webViewController<\/p>\n<p>    self.window?.makeKeyAndVisible()<\/p>\n<p>    return true<\/p>\n<p>}<\/p>\n<p>&#8220;`<\/p>\n<p>6. \u6253\u5305iOS\u5e94\u7528\u7a0b\u5e8f<\/p>\n<p>\u9009\u62e9\u201cProduct\u201d-&gt;\u201cArchive\u201d\uff0c\u5728\u201cOrganizer\u201d\u4e2d\u9009\u62e9\u201cExport\u201d\uff0c\u9009\u62e9\u201cAd Hoc\u201d\u6216\u201cApp Store\u201d\u8fdb\u884c\u6253\u5305\u3002\u5728\u6253\u5305\u8fc7\u7a0b\u4e2d\u9700\u8981\u9009\u62e9\u8bc1\u4e66\u3001\u914d\u7f6e\u6587\u4ef6\u548c\u8f93\u51fa\u8def\u5f84\u7b49\u4fe1\u606f\u3002<\/p>\n<p>7. \u5206\u53d1iOS\u5e94\u7528\u7a0b\u5e8f<\/p>\n<p>\u5c06\u6253\u5305\u597d\u7684IPA\u6587\u4ef6\u4e0a\u4f20\u5230\u82f9\u679c\u5f00\u53d1\u8005\u4e2d\u5fc3\u6216\u7b2c\u4e09\u65b9\u5e94\u7528\u5546\u5e97\u8fdb\u884c\u5206\u53d1\u3002\u5728\u4e0a\u4f20\u8fc7\u7a0b\u4e2d\u9700\u8981\u586b\u5199\u5e94\u7528\u540d\u79f0\u3001\u63cf\u8ff0\u3001\u622a\u56fe\u3001\u4ef7\u683c\u7b49\u4fe1\u606f\u3002<\/p>\n<p>\u4e09\u3001\u603b\u7ed3<\/p>\n<p>H5\u7f51\u9875\u6253\u5305iOS\u662f\u5c06\u57fa\u4e8eHTML5\u6280\u672f\u5f00\u53d1\u7684\u7f51\u9875\u5e94\u7528\u6253\u5305\u6210iOS\u5e94\u7528\u7a0b\u5e8f\uff0c\u4ee5\u4fbf\u5728\u82f9\u679c\u624b\u673a\u6216\u5e73\u677f\u4e0a\u8fd0\u884c\u3002\u5176\u539f\u7406\u662f\u901a\u8fc7\u7279\u5b9a\u7684\u5de5\u5177\u6216\u5e73\u53f0\u8fdb\u884c\u5c01\u88c5\uff0c\u751f\u6210iOS\u5e94\u7528\u7a0b\u5e8f\u5b89\u88c5\u5305\uff0c\u5e76\u901a\u8fc7\u82f9\u679c\u5f00\u53d1\u8005\u4e2d\u5fc3\u6216<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.cdn.yimenapp.com\/2023-03\/21\/14\/30300319819.jpg\" \/><\/figure>\n<\/p>\n<p>\u7b2c\u4e09\u65b9\u5e94\u7528\u5546\u5e97\u8fdb\u884c\u5206\u53d1\u3002\u6253\u5305iOS\u5e94\u7528\u7a0b\u5e8f\u7684\u5177\u4f53\u6b65\u9aa4\u5305\u62ec\u521b\u5efaXcode\u5de5\u7a0b\u3001\u5bfc\u5165H5\u7f51\u9875\u5e94\u7528\u3001\u4fee\u6539info.plist\u6587\u4ef6\u3001\u4fee\u6539AppDelegate.swift\u6587\u4ef6\u3001\u6253\u5305iOS\u5e94\u7528\u7a0b\u5e8f\u548c\u5206\u53d1iOS\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>H5\u7f51\u9875\u6253\u5305iOS\u6307\u7684\u662f\u5c06\u57fa\u4e8eHTML5\u6280\u672f\u5f00\u53d1\u7684\u7f51\u9875\u5e94\u7528\u6253\u5305\u6210iOS\u5e94\u7528\u7a0b\u5e8f\uff0c\u4ee5\u4fbf\u5728\u82f9\u679c\u624b\u673a\u6216\u5e73\u677f\u4e0a\u8fd0\u884c\u3002\u672c\u6587\u5c06\u4ecb\u7ecdH5\u7f51\u9875\u6253\u5305iOS\u7684\u539f\u7406\u4ee5\u53ca\u8be6\u7ec6\u6b65\u9aa4\u3002\u4e00\u3001\u539f\u7406H5\u7f51\u9875\u6253\u5305iOS\u7684\u539f\u7406\u662f\u5c06\u7f51\u9875\u5e94<\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[2690,2689,14,28,110],"topic":[],"class_list":["post-1317","post","type-post","status-publish","format-standard","hentry","category-hangye","tag-apk","tag-clionapp","tag-14","tag-28","tag-110"],"_links":{"self":[{"href":"https:\/\/www.yimenapp.cn\/yun\/wp-json\/wp\/v2\/posts\/1317","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenapp.cn\/yun\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenapp.cn\/yun\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenapp.cn\/yun\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenapp.cn\/yun\/wp-json\/wp\/v2\/comments?post=1317"}],"version-history":[{"count":0,"href":"https:\/\/www.yimenapp.cn\/yun\/wp-json\/wp\/v2\/posts\/1317\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yimenapp.cn\/yun\/wp-json\/wp\/v2\/media?parent=1317"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenapp.cn\/yun\/wp-json\/wp\/v2\/categories?post=1317"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenapp.cn\/yun\/wp-json\/wp\/v2\/tags?post=1317"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenapp.cn\/yun\/wp-json\/wp\/v2\/topic?post=1317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}