An open API service indexing awesome lists of open source software.

https://github.com/jaywcjlove/swift-check-update

Code to check if there is a new version on the App Store.
https://github.com/jaywcjlove/swift-check-update

check-update check-version ios macos package swift swift-package swiftui update-checker version

Last synced: 9 months ago
JSON representation

Code to check if there is a new version on the App Store.

Awesome Lists containing this project

README

          

CheckUpdate
===

[![Buy me a coffee](https://img.shields.io/badge/Buy%20me%20a%20coffee-048754?logo=buymeacoffee)](https://jaywcjlove.github.io/#/sponsor)
![SwiftUI Support](https://shields.io/badge/SwiftUI-macOS%20%7C%20iOS%20-green?logo=Swift&style=flat)

Code to check if there is a new version on the App Store, to determine whether an update prompt needs to be shown.

> [!TIP]
>
> After the app is released, it will not update immediately on the App Store; it needs to wait 24 hours before it works properly.

✦ My macOS/iOS application ✦


KeyClicker
DayBar
Iconed
RightMenu Master
Quick RSS
Quick RSS
Web Serve
Copybook Generator
DevTutor for SwiftUI
RegexMate
Time Passage
Iconize Folder
Textsound Saver
Create Custom Symbols
DevHub
Resume Revise
Palette Genius
Symbol Scribe

## Usage

```swift
import CheckUpdate

CheckUpdate.checkVersion { isUpdateNeeded, appStoreVersion, currentVersion in
// Here it checks whether an update prompt needs to be shown.
}

CheckUpdate.checkVersion(bundleId: "com.wangchujiang.daybar") {
isUpdateNeeded,
appStoreVersion,
currentVersion in

// appStoreVersion -> "1.0"
// currentVersion -> "2.0"
// isUpdateNeeded -> false
}

CheckUpdate.checkVersion(bundleId: "com.wangchujiang.daybar") {
isUpdateNeeded,
appStoreVersion,
currentVersion in

// appStoreVersion -> "2.0"
// currentVersion -> "1.0"
// isUpdateNeeded -> true
}
```

## License

Licensed under the MIT License.