I would like to manually check if there are new updates for my app while the user is in it, and prompt him to download the new version. Can I do this by checking the version of my app in the app store - programatically?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Xcode: Is there a way to change line spacing (UI L
- Unable to process app at this time due to a genera
new version on AppStore
swift 3.0
I saw many ways to check App update. so based on many answers I mix them and create my solution which is available on GitHub If Any update required Please let me know. This code for Swift 4
GitHub link To this code. https://github.com/anupgupta-arg/iOS-Swift-ArgAppUpdater
Refrence : https://stackoverflow.com/a/48810541/5855888 And https://github.com/emotality/ATAppUpdater
Happy Coding
Since I was facing the same problem, I found the answer provided by Mario Hendricks. Unfornatelly when I tryed to aply his code on my project, XCode did complain about Casting problems saying "MDLMaterialProperty has no subscript members". His code was trying to set this MDLMaterial... as the type of the constant "lookupResult", making the casting to "Int" failing every single time. My solution was to provide a type annotation for my variable to NSDictionary to be clear about the kind of value I needed. With that, I could access the value "version" that I needed.
Obs: For this YOURBUNDLEID, you can get from your Xcode project.... "Targets > General > Identity > Bundle Identifier"
So here is the my code with some simplifications as well:
All suggestions for improvement of this code are welcome!
Here is a simple code snippet that lets you know if the current version is different
Note: Make sure that when you enter the new version in iTunes, this matches the version in the app you are releasing. If not then the above code will always return YES regardless if the user updates.
to compare version string :
https://github.com/eure/AppVersionMonitor
This question was asked in 2011, I found it in 2018 while searching for some way for not only to check new version of app in App Store but also to notify user about it.
After small research I came to conclusion that answer of juanjo (related to Swift 3) https://stackoverflow.com/a/40939740/1218405 is the optimal solution if you want to do this in code by yourself
Also I can suggest two great projects on GitHub (2300+ stars each)
Example for Siren (AppDelegate.swift)