{"id":18605,"date":"2024-03-14T13:04:28","date_gmt":"2024-03-14T05:04:28","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=18605"},"modified":"2024-03-14T13:04:28","modified_gmt":"2024-03-14T05:04:28","slug":"%e8%8b%b9%e6%9e%9c%e7%bd%91%e9%a1%b5%e6%89%93%e5%8c%85app%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0%e7%9a%84","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/18605\/","title":{"rendered":"\u82f9\u679c\u7f51\u9875\u6253\u5305app\u5982\u4f55\u5b9e\u73b0\u7684?"},"content":{"rendered":"

\u82f9\u82f9\u679capp\u6253\u5305\u8f6f\u4ef6<\/a>\u679c\u7f51\u9875\u6253\u5305\u6210App\u662f\u6307\u5c06\u4e00\u4e2a\u7f51\u9875\u5e94\u7528\u6253\u5305\u6210iOS App\uff0c\u5728App Store\u4e0a\u53d1\u5e03\u5e76\u4f9b\u7528\u6237\u4e0b\u8f7d\u3002\u4e0b\u9762\u6211\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u4e00\u4e0b\u82f9\u679c\u7f51\u9875\u6253\u5305\u6210App\u7684\u539f\u7406\u548c\u64cd\u4f5c\u6b65\u9aa4\u3002<\/p>\n

1. \u539f\u7406\uff1a<\/p>\n

\u5728iOS\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7UIWebView\u6216WKWebView\u6765\u52a0\u8f7d\u7f51\u9875\uff0c\u5e76\u5c06\u5176\u663e\u793a\u5728\u5c4f\u5e55\u4e0a\u3002\u901a\u8fc7\u5c06\u7f51\u9875\u5e94\u7528\u5c01\u88c5\u5728\u4e00\u4e2a\u7279\u5b9a\u7684\u5bb9\u5668\u4e2d\uff0c\u5c31\u53ef\u4ee5\u6a21\u62df\u51fa\u4e00\u4e2a\u72ec\u7acb\u7684App\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7App Store\u4e0b\u8f7d\u5b89\u88c5\uff0c\u5e76\u76f4\u63a5\u5728\u8bbe\u5907\u4e0a\u8fd0\u884c\u3002\u8fd9\u6837\u7528\u6237\u5c31\u53ef\u4ee5\u50cf\u4f7f\u7528App\u4e00\u6837\u4f7f\u7528\u7f51\u9875\u5e94\u7528\uff0c\u800c\u4e0d\u9700\u8981\u6bcf\u6b21\u90fd\u6253\u5f00\u6d4f\u89c8\u5668\u3002<\/p>\n

2. \u64cd\u4f5c\u6b65\u9aa4\uff1a<\/p>\n

\uff081\uff09\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Xcode\u9879\u76ee\u3002<\/p>\n

\uff082\uff09\u9009\u62e9Single View App\u6a21\u677f\uff0c\u5e76\u586b\u5199\u76f8\u5173\u9879\u76ee\u4fe1\u606f\u3002<\/p>\n

\uff083\uff09\u5728\u9879\u76ee\u5bfc\u822a\u680f\u4e2d\uff0c\u627e\u5230\u9879\u76ee\u6587\u4ef6\uff0c\u5c06\u7f51\u9875\u6587\u4ef6\uff08HTML\u3001CSS\u3001JS\u7b49\uff09\u62d6\u62fd\u5230\u9879\u76ee\u6587\u4ef6\u5939\u4e2d\u3002<\/p>\n

\uff084\uff09\u5728\u9879\u76ee\u8bbe\u7f6e\u4e2d\uff0c\u5c06App\u7684\u542f\u52a8\u9875<\/p>\n

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

\u9762\u8bbe\u7f6e\u4e3a\u7f51\u9875\u3002\u5728Info.plist\u6587\u4ef6\u4e2d\u6dfb\u52a0\u201cNSAp\u6253\u5305\u82f9\u679capp\u4e0a\u67b6\u9700\u8981\u591a\u4e45<\/a>pTransportSecurity\u201d\u952e\uff0c\u5e76\u5c06\u5176\u503c\u8bbe\u4e3a\u201cNSAllowsArbitraryLoads\u201d\u3002<\/p>\n

\uff085\uff09\u5728\u9879\u76ee\u6587\u4ef6\u4e2d\u7684ViewController\u4e2d\uff0c\u6dfb\u52a0WebView\u63a7\u4ef6\uff0c\u5e76\u8bbe\u7f6e\u5176\u52a0\u8f7d\u8d77\u59cb\u9875\u9762\u3002<\/p>\n

\uff086\uff09\u6784\u5efa\u5e76\u8fd0\u884cApp\u3002<\/p>\n

\uff087\uff09\u6839\u636e\u9700\u8981\uff0c\u53ef\u4ee5\u5728Xcode\u4e2d\u8fdb\u884c\u66f4\u591a\u7684\u5b9a\u5236\u5316\u8bbe\u7f6e\uff0c\u5982\u5bfc\u822a\u680f\u6837\u5f0f\u3001\u542f\u52a8\u56fe\u6807\u7b49\u3002<\/p>\n

3. \u6ce8\u610f\u4e8b\u9879\uff1a<\/p>\n

\uff081\uff09\u5728\u5c06\u7f51\u9875\u6253\u5305\u6210App\u65f6\uff0c\u8981\u6ce8\u610f\u9875\u9762\u5e03\u5c40\u7684\u9002\u914d\u6027\u3002\u56e0\u4e3a\u7f51\u9875\u4e00\u822c\u662f\u4e3a\u6d4f\u89c8\u5668\u73af\u5883\u8bbe\u8ba1\u7684\uff0c\u800cApp\u5219\u9700\u8981\u8003\u8651\u5404\u79cd\u8bbe\u5907\u5c4f\u5e55\u7684\u9002\u914d\u95ee\u9898\uff0c\u5982iPhone\u548ciPad\u7684\u5c4f\u5e55\u5c3a\u5bf8\u5dee\u5f02\u3002<\/p>\n

\uff082\uff09\u53e6\u5916\uff0c\u8fd8\u8981\u6ce8\u610f\u5904\u7406\u7f51\u9875\u4e2d\u53ef\u80fd\u5b58\u5728\u7684\u4e00\u4e9b\u4ea4\u4e92\u95ee\u9898\uff0c\u5982App\u4e2d\u662f\u5426\u9700\u8981\u6dfb\u52a0\u5bfc\u822a\u680f\u3001\u5e95\u90e8\u5de5\u5177\u680f\u7b49\u64cd\u4f5c\u754c\u9762\u3002<\/p>\n

\uff083\uff09\u8fd8\u9700\u8981\u8003\u8651\u4e00\u4e9b\u5176\u4ed6\u56e0\u7d20\uff0c\u5982\u7f51\u9875\u4e2d\u7684\u8d44\u6e90\u6587\u4ef6\uff08\u5982\u56fe\u7247\u3001\u97f3\u9891\uff09\u7684\u52a0\u8f7d\u548c\u7f13\u5b58\u3001App\u7684\u6027\u80fd\u4f18\u5316\u7b49\u3002<\/p>\n

\u603b\u7ed3\uff1a<\/p>\n

\u901a\u8fc7\u5c06\u7f51\u9875\u5e94\u7528\u5c01\u88c5\u6210App\uff0c\u53ef\u4ee5\u66f4\u65b9\u4fbf\u5730\u5728\u79fb\u52a8\u8bbe\u5907\u4e0a\u4f7f\u7528\uff0c\u63d0\u4f9b\u66f4\u597d\u7684\u7528\u6237\u4f53\u9a8c\u3002\u6253\u5305\u8fc7\u7a0b\u76f8\u5bf9\u7b80\u5355\uff0c\u4f46\u9700\u8981\u8003\u8651\u9002\u914d\u6027\u548c\u4ea4\u4e92\u95ee\u9898\u3002\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u901a\u8fc7Xcode\u7684\u66f4\u591a\u5b9a\u5236\u5316\u8bbe\u7f6e\u6765\u4f18\u5316App\u7684\u5c55\u793a\u6548\u679c\u548c\u6027\u80fd\u3002\u5e0c\u671b\u4ee5\u4e0a\u5185\u5bb9\u80fd\u5bf9\u4f60\u7406\u89e3\u82f9\u679c\u7f51\u9875\u6253\u5305\u6210App\u6709\u6240\u5e2e\u52a9\u3002\u5982\u6709\u4e0d\u6e05\u695a\u7684\u5730\u65b9\uff0c\u53ef\u4ee5\u8fdb\u4e00\u6b65\u4ea4\u6d41\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u82f9\u679c\u7f51\u9875\u6253\u5305\u6210App\u662f\u6307\u5c06\u4e00\u4e2a\u7f51\u9875\u5e94\u7528\u6253\u5305\u6210iOS App\uff0c\u5728App Store\u4e0a\u53d1\u5e03\u5e76\u4f9b\u7528\u6237\u4e0b\u8f7d\u3002\u4e0b\u9762\u6211\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u4e00\u4e0b\u82f9\u679c\u7f51\u9875\u6253\u5305\u6210App\u7684\u539f\u7406\u548c\u64cd\u4f5c\u6b65\u9aa4\u30021. \u539f\u7406\uff1a\u5728iOS\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7UIWe<\/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":[47,16,149,5437,23],"topic":[],"class_list":["post-18605","post","type-post","status-publish","format-standard","hentry","category-appkf","tag-vueapp","tag-16","tag-149","tag-appxcode","tag-23"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/18605","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=18605"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/18605\/revisions"}],"predecessor-version":[{"id":18660,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/18605\/revisions\/18660"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=18605"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=18605"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=18605"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=18605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}