I'm creating an in-house app to deliver updated apps that our business clients can install wirelessly.
Ultimately the way I'm launching the install is:
NSURL *otaURL = [NSURL URLWithString:@"itms-services://?action=download-manifest&url=<<my-url.plist>>"];
[[UIApplication sharedApplication] openURL:otaURL];
This works fine but we've noticed that it will sometimes keep a cache of the plist or the ipa file and install an old version. We have ruled out that it's not updating on the server because we can even delete the ipa file from the server and it will still install an old version.
Changing the .plist and .ipa file name will work but isn't really the desired end state so my question is: Is there a way to force the device to go out and get the file from the server instead of relying on it's cache?
I had a very similar issue, and I solved it with a (dirty) workaround; still better than creating a different .plist file for each new version.
I insert some random numbers in the url such as:
NSURL *otaURL = [NSURL URLWithString:[NSString stringWithFormat:@"itms-services://?action=download-manifest&url=myapp.%d.plist", arc4random() % 10000];
[[UIApplication sharedApplication] openURL:otaURL];
On the other side, I add a rule in .htaccess (supposing Apache, configured with mod_rewrite):
AddType application/octet-stream ipa
AddType text/xml plist
RewriteEngine on
RewriteRule (.*)\.\d+\.plist $1.plist
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With