Install Siren via Swift Package Manager
masterTo add Siren to your iOS or tvOS project, use the Swift Package Manager with the following dependency declaration:
.package(url: "https://github.com/ArtSabintsev/Siren.git", from: "7.0.0")repository·master·Indexed 26 days ago
https://github.com/artsabintsev/sirenA Swift library for iOS and tvOS that checks the installed app version against the App Store. It provides customizable, localized alerts for forced, optional, or skipped updates via the Rules.AlertType enum.
To add Siren to your iOS or tvOS project, use the Swift Package Manager with the following dependency declaration:
.package(url: "https://github.com/ArtSabintsev/Siren.git", from: "7.0.0")To start checking for updates, import Siren and call Siren.shared.wail() in your app's entry point. You can place this in either AppDelegate.swift or SceneDelegate.swift.
import Siren // Line 1
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
window?.makeKeyAndVisible()
Siren.shared.wail() // Line 2
return true
}
}To verify Siren is working in your development environment:
.xcodeproj file) to an older version than what is currently in the App Store.Alternatively, if your app is not yet in the store, change your bundleID to an existing app's ID (e.g., Facebook's com.facebook.Facebook) to trigger the check.
By default, Siren uses the user's device locale. To override this and force the update dialog to appear in a specific language, assign a new PresentationManager to Siren.shared.presentationManager with the forceLanguageLocalization parameter.
// In this example, we force the `Russian` language.
Siren.shared.presentationManager = PresentationManager(forceLanguageLocalization: .russian)Siren provides three types of update alerts controlled by the Rules.AlertType enum:
showAlertAfterCurrentVersionHasBeenReleasedForDays property.