VersionUpdater
Notify users when a new version of your app is available and force them to upgrade the application of the version.
Install / Use
/learn @nakajijapan/VersionUpdaterREADME
VersionUpdater
Inform users about new app version releases and optionally force updates.
Inspired by: https://github.com/kazu0620/SRGVersionUpdater (Objective-C)
Requirements
- iOS 15.0+
- Xcode 15+
- Swift 5.9+
Installation
Swift Package Manager (Recommended)
Add to your Package.swift:
dependencies: [
.package(url: "https://github.com/nakajijapan/VersionUpdater.git", from: "2.0.0")
]
Or add it via Xcode: File > Add Package Dependencies and enter the repository URL.
CocoaPods
pod "VersionUpdater", "~> 2.0"
Usage
JSON Endpoint
Provide a JSON endpoint that returns version information:
{
"required_version": "2.0.0",
"type": "force",
"update_url": "https://apps.apple.com/app/id123456789"
}
type:"force"(only download button) or"optional"(download + cancel buttons)
Basic Usage
import VersionUpdater
let updater = VersionUpdater(
endPointURL: URL(string: "https://example.com/ios.json")!
)
Task {
try await updater.executeVersionCheck()
}
Custom Alert Text
let updater = VersionUpdater(
endPointURL: URL(string: "https://example.com/ios.json")!,
customAlertTitle: "Update Available",
customAlertBody: "A new version is available."
)
Fetch Version Info Without UI
let info = try await updater.fetchVersionInfo()
print(info.requiredVersion) // "2.0.0"
print(info.type) // .force or .optional
Version Comparison
let needsUpdate = updater.isUpdateNeeded(
currentVersion: "1.0.0",
requiredVersion: "2.0.0"
)
Author
nakajijapan, pp.kupepo.gattyanmo@gmail.com
License
VersionUpdater is available under the MIT license. See the LICENSE file for more info.
Related Skills
node-connect
354.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
112.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
354.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
354.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
