A powerful force update library for Swift.
You can set Version of your app remote and show dialog to force update your app whenever you want.
In order to use this library you need to create Firebase project and add RemoteConfig parameters. Configuration showed in Introduction section.
UpdateMe is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "UpdateMe"
- Create Firebase project http://firebase.google.com
- Firebase will give you google-services.json file. Paste this file into your projects root directory.
- In the left menu choose remote config and add these parameters.
- Add these parameters
Parameter Key | Default Value |
---|---|
ios_update_me_required | Do you want to force update App (Ex: false |
ios_update_me_current_version | The version of your app(Ex: 1.0.0) |
ios_update_me_store_url | The store url(Ex: http://play.google.com/store/apps/com.salyangoz.torrentfinder) |
ios_update_me_dialog_title | Update dialog title(You can leave blank) |
ios_update_me_dialog_description | Update dialog message(You can leave blank) |
You should add this code block in View Controller's viewDidAppear function.
override func viewDidAppear(_ animated: Bool) {
//Basic Usage
UpdateMe.with().build().check()
}
Features
- Set dialog visibility
- Add listeners to Positive and Negative button clicks.
- Set positive and negative button text and colors.
- Set custom icon
override func viewDidAppear(_ animated: Bool) {
//Advanced Usage
let update:UpdateMe = UpdateMe.with(fetchIntervalInSeconds: 30)
.setDialogIcon(image: UIImage(named: "info.png")!)
.setTopColor(color: 0xDF5745)
.onPositiveButtonClick(onPositiveButtonClickListener: self)
.onNegativeButtonClick(onNegativeButtonClickListener: self)
.onUpdateNeeded(onUpdateNeededListener: self)
.setContinueButtonVisibility(visible: true)
.setPositiveButtonText(title: "Update")
.setPositiveButtonTextColor(color: UIColor.orange)
.build()
update.check()
}
Custom alert dialogs pulled from SCLAlertView for Swift repository. https://github.com/vikmeup/SCLAlertView-Swift
Salyangoz Co. , [email protected]
UpdateMe is available under the MIT license. See the LICENSE file for more info.