10

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?

Trey
  • 101
  • 1
  • 5

2 Answers2

3

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
etienne
  • 3,146
  • 1
  • 24
  • 45
0

I think people at TestFlight ran into the same problem. When using their services, I found out that updating the app without removing any existing older version first could lead to a very buggy behavior with half of an old version running (icons for instance) and half of the new behavior too.

That was really weird. Cf. this other question: Why are some files not correctly installed when installing via TestFlight?

You should try to get in touch with Apple's support or TestFlight guys to see if they fixed this issue. Good luck with this!

Community
  • 1
  • 1
Mick F
  • 7,312
  • 6
  • 51
  • 98
  • Thanks for the tip, I researched it more and then it fell by the wayside, but then I saw this today and wondered if would fix the problem. Haven't tested it yet though. http://stackoverflow.com/questions/12712785/issue-with-uiwebview-caching-pages – Trey Oct 03 '12 at 18:05