动态生成ios plist的方法

freemarker模板




    
        items
        
            
                assets
                
                    
                        kind
                        software-package
                        url
                        ${ipaDownloadUrl}
                    
                
                metadata
                
                    bundle-identifier
                    ${identifier}
                    bundle-version
                    ${version}
                    kind
                    software
                    subtitle
                    ${subtitle}
                    title
                    ${title}
                
            
        
    

controller

    @RequestMapping(value = "/plist/{id}",method = RequestMethod.GET)
    public void plist(HttpServletResponse response,@PathVariable String id) throws IOException, TemplateException {
        
        Map 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下载方案

对于这个plist的接口,如果不是PathVariable的参数,而是RequestParam这种,通过itms-services无法发送对plist的请求,后来把参数都改为经过PathVariable才可以。

itms-services://?action=download-manifest&url=https://xxxxxx/plist/xxxxx

doc

  • ipapk-server

  • 使用itms-services从浏览器发布iOS App遇到的问题总结

  • iOS9AdaptationTips

  • iOS9企业部署分发无法安装问题深入解决

你可能感兴趣的:(ios)