SkillAgentSearch skills...

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/VersionUpdater
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

VersionUpdater

License Platform

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

View on GitHub
GitHub Stars10
CategoryDevelopment
Updated18d ago
Forks4

Languages

Swift

Security Score

95/100

Audited on Mar 24, 2026

No findings