<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>items</key> <array> <dict> <key>assets</key> <array> <dict> <key>kind</key> <string>software-package</string> <key>url</key> <string>${ipaDownloadUrl}</string> </dict> </array> <key>metadata</key> <dict> <key>bundle-identifier</key> <string>${identifier}</string> <key>bundle-version</key> <string>${version}</string> <key>kind</key> <string>software</string> <key>subtitle</key> <string>${subtitle}</string> <key>title</key> <string>${title}</string> </dict> </dict> </array> </dict> </plist>
@RequestMapping(value = "/plist/{id}",method = RequestMethod.GET) public void plist(HttpServletResponse response,@PathVariable String id) throws IOException, TemplateException { Map<String,Object> data = new HashMap<>(); //put variables //.... //convert to string String content = FreemarkerUtil.generateContent("plist.ftl",data); response.setHeader("Content-Type", "application/octet-stream; charset=utf-8"); response.setHeader("Content-Disposition", "attachment;filename=app.plist"); response.getWriter().write(content.toCharArray()); }
參考二維碼app下載方案html
對於這個plist的接口,若是不是PathVariable的參數,而是RequestParam這種,經過itms-services沒法發送對plist的請求,後來把參數都改成通過PathVariable才能夠。ios
itms-services://?action=download-manifest&url=https://xxxxxx/plist/xxxxxgit
ipapk-servergithub
使用itms-services從瀏覽器發佈iOS App遇到的問題總結segmentfault