CocoaPods trunk is moving to be read-only. Read more on the blog, there are 14 months to go.
| TestsTested | ✗ |
| LangLanguage | Obj-CObjective C |
| License | MIT |
| ReleasedLast Release | Oct 2016 |
Maintained by Richard Szabo, Dávid Horváth, Balazs Kovacs.
SCForceUpdater is a simple pod which implements force update functionality for your iOS projects.
To run the example project:
pod install from the Example directory,You can start the example server by:
cd TestServer/,bundle install to install dependencies,ruby app.rb.This will bring up the test server listening on http://localhost:4567.
SCForceUpdater is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "SCForceUpdater"
SCForceUpdater provides class methods to configure it.
First you should call SCForceUpdater's initialization method: initWithITunesAppId:baseURL:versionAPIEndpoint:.
A good place to do this at the beginning of your application delegate's application:didFinishLaunchingWithOptions: method.
Also you should call the checkForUpdate method on the [SCForceUpdater sharedUpdater] singleton instance. We recommand to do this in the applicationDidBecomeActive: method of your application delegate class.
You can also customize the localization of the application: first you should set setAlwaysUseMainBundle: to YES, after this you should be able to redefine the following locales:
| Key | Meaning |
|---|---|
| sc.force-updater.soft.title | Title for soft update |
| sc.force-updater.soft.message | Message for soft update |
| sc.force-updater.soft.update | Update button text for soft update |
| sc.force-updater.soft.later | Later button text for soft update |
| sc.force-updater.soft.no-thanks | No thanks! button text for soft update |
| sc.force-updater.hard.title | Title for hard update |
| sc.force-updater.hard.message | Message for hard update |
| sc.force-updater.hard.update | Update button text for hard update |
Messages (sc.force-updater.[soft|hard].message) are formattable. There is two parameter that they can handle: display name of the application and the upcoming version.
Like in the default localization: "Great news! There’s an updated version of {displayName} ({versionNumber}), we recommend you install it."
You can set the displayName of your application if you want. You can achive this by calling the setDisplayName: class method with the required name.
We are parsing JSON objects inside the pod. The default keys are: last_version for the version key and update_type for the update type key.
The defaults can be changed through two setter methods: setLastVersionResponseKey: and setUpdateTypeResponseKey:.
Contributions are always welcome! :)
git checkout -b my-new-feature)git commit -am 'Add some feature')git push origin my-new-feature)SCForceUpdater is available under the MIT license. See the LICENSE file for more info.