1. Get local version and Internet version
nsdictionary *infodictionary = [[nsbundle mainbundle] Infodictionary];
nsstring * localversion = [infodictionary objectforkey:@ " Cfbundleshortversionstring "];
nsstring * netversion = [nsstring stringwithformat:@ "%@" /c6>, paramdic[@ "clientversion"];
2, compare the local version and the Internet version, if there is the latest version, to download
3. Use of third party platform website Tools on the fir.im to enable Automatic Updates
3.1, query the platform to install the version
[nsstringstringwithformat:@ "http://api.fir.im/apps/%@/ download_token?api_token=%@ ", Idstr,token]
3.2, get the address of the direct installation
NSString * DownloadURL = [nsstringstringwithformat:@ "Https://download.fir.im/apps/%@/install? download_token=%@ ", Idstr,downloadtoken]
3.3, need to encode the address, and then to lowercase
nsstring *encodeurl = [DownloadURL Stringbyaddingpercentencodingwithallowedcharacters: [nscharacterset Urlhostallowedcharacterset]];
nsstring *url =[nsstring stringwithformat:@ " itms-services://?action=download-manifest&url=%@ ", [[Encodeurl Stringbyreplacingoccurrencesofstring:@ "="withstring:@ "%3d" ] [ lowercasestring]];
4. Download the latest version automatically
if ([[uiapplication sharedapplication] Canopenurl: [nsurl urlwithstring: url]]) {
[ [uiapplication sharedapplication]openURL: [Nsurl urlwithstring : url] Options : @{} Completionhandler : Nil ]; }
iOS Enterprise Edition automatically updates with third-party implementations