Couldn't find any information regarding this... if I launch a SKStoreProductViewController
instance from within my app, feeding it the iTunes URL of that app, does it allow for app updates? In other words I'd like to have an "Update" button within my app that shows a SKStoreProductViewController
and allows the user to update the app from there.
This is hard to verify as SKStoreProductViewController
is running a "sandboxed" version of the App Store, and that I'm not sure what determines whether it shows the "Open" or "Update" button.
I can verify that update does in fact show when presenting an owned app, that is installed that also has an update.
It of course also shows "Install" for apps you own but don't have installed and "Open" for apps installed and up to date.
This is using production code in a shipped app though I still couldn't find any verification in Apple's docs.
If you are trying to Update The currently open app in an SKStoreProductViewController
, it will throw an error on later versions of iOS as unable to install. Instead you should open the app store URL to force the App Store to open. itms-apps://itunes.apple.com/app/apple-store/id375380948?mt=8
It has been a while since this question has had love, but it seems it's not fully resolved. I'm going to add what I've found.
Here's the way I ran my test. We're just getting the first release of our app developed and don't have a release on the app store. So what I did was I took a bundle Id from another app I have on the app store, put it in my new app in Xcode 8.3, and tested this update functionality. I'm interested in the question of: Can app A update itself using the SKStoreProductViewController
?
1) iOS 10.3 on iPhone. I've run the test and it works in the 6 or so trials I've made. What happens is that when I do the install from within SKStoreProductViewController
, it crashes my app (not surprising-- I'm installing over the "same" app-- an app with the same bundle Id), but the install proceeds. You see the regular download progress indicator you normally see for an app download from the app store.
2) iOS 11 on an iPad (iOS11, beta 5, I believe-- the build number is 15A5341f). When attempting the update (update app A from within app A), using SKStoreProductViewController
, this did not work. I get the following alert after pressing on the "update" button. I've tried this several times. The app doesn't crash. It just doesn't download the "update". I'm not sure if this is typical of beta versions of iOS, or is a change in the SKStoreProductViewController
behavior.
3) iOS 11, same device: But tried to update app B from within app A. I ran this test to see if the problem was that I just couldn't do download at all within SKStoreProductViewController
in a beta version. This worked. I was able to do the download in this case.
I'll try to report back in on a test once iOS 11 is released-- to see if my test 2) then works or stays the same.
Interestingly, I tried the same for my own app, where I tried to show my app's ID inside the SKStoreProductViewController, by detecting an earlier version of the app. The screen was visible, the update button was there, HOWEVER, clicking on update, and still remaining in the app's context made SKStore throw an error "Cannot download at this time". However, I haven't tried immediately exiting the app after clicking on update should work
Its probably because an app must be exited before an update can be performed?
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