{"id":26318,"date":"2024-05-21T11:56:53","date_gmt":"2024-05-21T03:56:53","guid":{"rendered":"https:\/\/www.zhidianwl.net\/zhidianwl\/?p=26318"},"modified":"2024-05-21T11:56:53","modified_gmt":"2024-05-21T03:56:53","slug":"ios%e6%8f%8f%e8%bf%b0%e6%96%87%e4%bb%b6%e6%89%93%e5%8c%85webapp%e6%80%8e%e4%b9%88%e5%81%9a%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.zhidianwl.net\/zhidianwl\/2024\/05\/21\/ios%e6%8f%8f%e8%bf%b0%e6%96%87%e4%bb%b6%e6%89%93%e5%8c%85webapp%e6%80%8e%e4%b9%88%e5%81%9a%ef%bc%9f\/","title":{"rendered":"ios\u63cf\u8ff0\u6587\u4ef6\u6253\u5305webapp\u600e\u4e48\u505a\uff1f"},"content":{"rendered":"

iOS\u63cf\u8ff0\u6587\u4ef6\u662f\u4e00\u79cd\u7528\u4e8e\u5b89\u88c5\u548c\u914d\u7f6eiOS\u5e94\u7528\u7a0b\u5e8f\u7684\u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u542b\u4e86\u5e94\u7528\u7a0b\u5e8f\u7684\u8bc1\u4e66\u3001\u6743\u9650\u3001\u6807\u8bc6\u3001\u8bbe\u5907\u5217\u8868\u7b49\u4fe1\u606f\u3002\u5728iOS\u5f00\u53d1\u4e2d\uff0c\u6211\u4eec\u901a\u5e38\u9700\u8981\u5c06\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210ipa\u6587\u4ef6\uff0c\u7136\u540e\u901a\u8fc7\u63cf\u8ff0\u6587\u4ef6\u8fdb\u884c\u7b7e\u540d\u548c\u5b89\u88c5\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528iOS\u63cf\u8ff0\u6587\u4ef6\u6253\u5305WebApp\u3002<\/p>\n

\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u4e86\u89e3WebApp\u7684\u6982\u5ff5\u3002WebApp\u662f\u4e00\u79cd\u4f7f\u7528Web\u6280\u672f\u5f00\u53d1\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u5b83\u53ef\u4ee5\u8fd0\u884c\u5728\u79fb\u52a8\u8bbe\u5907\u7684\u6d4f\u89c8\u5668\u4e2d\uff0c\u5177\u6709\u7c7b\u4f3c\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\u7684\u7528\u6237\u4f53\u9a8c\u3002WebApp\u901a\u5e38\u5305\u542bHTML\u3001CSS\u3001JavaScript\u7b49\u6587\u4ef6\uff0c\u53ef\u4ee5\u901a\u8fc7\u6d4f\u89c8\u5668\u6216\u8005\u684c\u9762\u5feb\u6377\u65b9\u5f0f\u542f\u52a8\u3002<\/p>\n

\u5728iOS\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7Safari\u6d4f\u89c8\u5668\u5c06WebApp\u6dfb\u52a0\u5230\u4e3b\u5c4f\u5e55\uff0c\u5e76\u4e14\u901a\u8fc7\u63cf\u8ff0\u6587\u4ef6\u8fdb\u884c\u7b7e\u540d\u548c\u5b89\u88c5\u3002\u4e0b\u9762\u662f\u5177\u4f53\u7684\u6b65\u9aa4\uff1a<\/p>\n

1. \u521b\u5efa\u4e00\u4e2aWebApp\uff0c\u5305\u542bHTML\u3001CSS\u3001JavaScript\u7b49\u6587\u4ef6\u3002<\/p>\n

2. \u5728WebApp\u7684\u6839\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u540d\u4e3amanifest.plist\u7684\u6587\u4ef6\uff0c\u7528\u4e8e\u63cf\u8ff0WebApp\u7684\u4fe1\u606f\u3002\u8be5\u6587\u4ef6\u5305\u542b\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n

“`<\/p>\n

CFBundleDisplayName<\/p>\n

WebApp\u540d\u79f0<\/p>\n

CFBundleIdentifier<\/p>\n

com.example.webapp<\/p>\n

CFBundleShortVersionString<\/p>\n

1.0<\/p>\n

CFBundleVersion<\/p>\n

1<\/p>\n

StartURL<\/p>\n

http:\/\/www.example.com\/index.html<\/p>\n

“`<\/p>\n

\u5176\u4e2d\uff0cCFBundleDisplayName\u8868\u793aWebApp\u7684\u540d\u79f0\uff0cCFBundleIdentifier\u8868\u793aWebApp\u7684\u552f\u4e00\u6807\u8bc6\uff0cCFBundleShortVersionString\u548cCFBundleVersion\u8868\u793aWebApp\u7684\u7248\u672c\u53f7\uff0cStartURL\u8868\u793aWebApp\u7684\u542f\u52a8\u9875\u9762\u3002<\/p>\n

3. \u5728WebApp\u7684\u6839\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u540d\u4e3aicons\u7684\u6587\u4ef6\u5939\uff0c\u7528\u4e8e\u5b58\u653eWebApp\u7684\u56fe\u6807\u3002\u8be5\u6587\u4ef6\u5939\u5305\u542b\u4ee5\u4e0b\u6587\u4ef6\uff1a<\/p>\n

– icon-57.png: 57×57\u50cf\u7d20\u7684\u56fe\u6807<\/p>\n

– icon-72.png: 72×72\u50cf\u7d20\u7684\u56fe\u6807<\/p>\n

– icon-114.png: 114×114\u50cf\u7d20\u7684\u56fe\u6807<\/p>\n

– icapk\u751f\u6210\u8fde\u63a5<\/a>on-144.png: 144×144\u50cf\u7d20\u7684\u56fe\u6807<\/p>\n

4. \u5728WebApp\u7684\u6839\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u540d\u4e3aindex.html\u7684\u6587\u4ef6\uff0c\u7528\u4e8e\u4f5c\u4e3aWebApp\u7684\u542f\u52a8\u9875\u9762\u3002<\/p>\n

5. \u5728WebApp\u7684\u6839\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u540d\u4e3aplist.php\u7684\u6587\u4ef6\uff0c\u7528\u4e8e\u751f\u6210\u63cf\u8ff0\u6587\u4ef6\u3002\u8be5\u6587\u4ef6\u5305\u542b\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n

“`<\/p>\n<\/p>\n

header(‘Content-Type: application\/xml’);<\/p>\n

header(‘Content-Disposition: attachment; filename=”manifest.plist”‘);<\/p>\n

?><\/p>\n<\/p>\n

\n

\n

\n

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

CFBundleDisplayName<\/p>\n

WebApp\u540d\u79f0<\/p>\n

CFBundleIdentifier<\/p>\n

com.example.webapp<\/p>\n

CFBundleShortVersionString<\/p>\n

1.0<\/p>\n

CFBundleVersion<\/p>\n

1<\/p>\n

StartURL<\/p>\n

http:\/\/www.example.com\/index.html<\/p>\n

icons<\/p>\n

\n

icon-57<\/p>\n

http:\/\/www.example.com\/icons\/icon-57.png<\/p>\n

icon-72<\/p>\n

http:\/\/www.example.com\/icons\/icon-72.png<\/p>\n

icon-114<\/p>\n

http:\/\/www.example.com\/icons\/icon-114.png<\/p>\n

icon-144<\/p>\n

http:\/\/www.example.com\/icons\/icon-144.png<\/p>\n<\/p>\n<\/p>\n

“`<\/p>\n

6. \u5728WebApp\u7684\u6839\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u540d\u4e3ainstall.php\u7684\u6587\u4ef6\uff0c\u7528\u4e8e\u5b89\u88c5WebApp\u3002\u8be5\u6587\u4ef6\u5305\u542b\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n

“`<\/p>\n<\/p>\n

header(‘Content-Type: application\/octet-stream’);<\/p>\n

header(‘Content-Disposition: attachment; filename=”webapp.ipa”‘);<\/p>\n

readfile(‘webapp.ipa’);<\/p>\n

?><\/p>\n

“`<\/p>\n

\u5176\u4e2d\uff0cwebapp.ipa\u662f\u901a\u8fc7Xcode\u6253\u5305\u751f\u6210\u7684WebApp\u3002<\/p>\n

associated domains<\/a>7. \u5c06WebApp\u4e0a\u4f20\u5230\u670d\u52a1\u5668\uff0c\u5e76\u4e14\u5c06manifest.plist\u3001icons\u3001index.html\u3001plist.php\u3001install.php\u7b49\u6587\u4ef6\u653e\u7f6e\u5728\u540c\u4e00\u76ee\u5f55\u4e0b\u3002<\/p>\n

8. \u5728Safari\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00WebApp\u7684\u542f\u52a8\u9875\u9762\uff0c\u7136\u540e\u5c06WebApp\u6dfb\u52a0\u5230\u4e3b\u5c4f\u5e55\u3002<\/p>\n

9. \u5728\u4e3b\u5c4f\u5e55\u4e2d\u6253\u5f00WebApp\uff0c\u7136\u540e\u70b9\u51fb\u5b89\u88c5\u6309\u94ae\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n

10. \u8f93\u5165\u63cf\u8ff0\u6587\u4ef6\u7684\u5b89\u88c5\u5bc6\u7801\uff0c\u7136\u540e\u7b49\u5f85\u5b89\u88c5\u5b8c\u6210\u3002<\/p>\n

\u603b\u7684\u6765\u8bf4\uff0c\u4f7f\u7528iOS\u63cf\u8ff0\u6587\u4ef6\u6253\u5305WebApp\u7684\u8fc7\u7a0b\u6bd4\u8f83\u7b80\u5355\uff0c\u9700\u8981\u6ce8\u610f\u7684\u662f\u63cf\u8ff0\u6587\u4ef6\u7684\u751f\u6210\u548c\u5b89\u88c5\u8fc7\u7a0b\u3002\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06WebApp\u6253\u5305\u6210ipa\u6587\u4ef6\uff0c\u5e76\u4e14\u901a\u8fc7\u63cf\u8ff0\u6587\u4ef6\u8fdb\u884c\u7b7e\u540d\u548c\u5b89\u88c5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

iOS\u63cf\u8ff0\u6587\u4ef6\u662f\u4e00\u79cd\u7528\u4e8e\u5b89\u88c5\u548c\u914d\u7f6eiOS\u5e94\u7528\u7a0b\u5e8f\u7684\u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u542b\u4e86\u5e94\u7528\u7a0b\u5e8f\u7684\u8bc1\u4e66\u3001\u6743\u9650\u3001\u6807\u8bc6\u3001\u8bbe\u5907\u5217\u8868\u7b49\u4fe1\u606f\u3002\u5728iOS\u5f00\u53d1\u4e2d\uff0c\u6211\u4eec\u901a\u5e38\u9700\u8981\u5c06\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210ipa\u6587\u4ef6\uff0c\u7136\u540e\u901a\u8fc7\u63cf\u8ff0\u6587\u4ef6\u8fdb\u884c\u7b7e\u540d\u548c\u5b89\u88c5\u3002<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1032,25276,12,19566,23268],"topic":[],"class_list":["post-26318","post","type-post","status-publish","format-standard","hentry","category-kaifaapp","tag-1032","tag-25276","tag-12","tag-19566","tag-app"],"_links":{"self":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/26318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/comments?post=26318"}],"version-history":[{"count":1,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/26318\/revisions"}],"predecessor-version":[{"id":26334,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/26318\/revisions\/26334"}],"wp:attachment":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/media?parent=26318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/categories?post=26318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/tags?post=26318"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/topic?post=26318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}