Swiftpack.co - manasv/Updeto as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by manasv.
manasv/Updeto 0.1.0
✅ Update checker for iOS Apps
⭐️ 8
🕓 1 year ago
iOS
.package(url: "https://github.com/manasv/Updeto.git", from: "0.1.0")

Updeto

✅ Update checker for iOS Apps

Summary

Updeto is a simple package that will help you to check if the currently installed version is the same as the latest one available on App Store.

Installation

Updeto is available via Swift Package Manager

Using Xcode go to File -> Swift Packages -> Add Package Dependency and enter https://github.com/manasv/Updeto

Usage

The convenience API yet simple, has mainly two methods depending on your preference to retrieve the update status, either with Combine or via completion block.

If you are either on iOS / iPadOS, you will have access to a singleton that automatically retrieves the Bundle ID and App Version in your app.

Updeto.shared.isAppUpdated { result in
    switch result {
    case .updated:
        // Do something 
    case .outdated:
        // Do something 
    case .noResults:
        // Do something
    case .developmentOrBeta:
        // Do something
    }
}

Also you can create your own Updeto instance from the provided inits, requiring you to provide bundleId and currentAppVersion, you can optionally provide appId if you already know the one for your app, or it will be written when the Appstore Lookup is made, so you can after that perform something with the URL like:

if let url = Updeto.shared.appstoreURL {
    UIApplication.shared.canOpenURL(url){
        UIApplication.shared.openURL(url)
    }
}

Or whatever you want to do with the URL.

TODOs

  • ☐ Improve the way appstoreURL is used, as right now if it's not set, is only a nil value.
  • ☐ Any other functionality that can be useful with what's provided by the Appstore Lookup
  • ☐ Decent rework to improve unit testing

Considerations

This is a undocumented API (or kinda API), so Apple may change it in any moment and the result may change, use it at your own risk, however I will try to maintain it as up to date as possible to bring the same functionality.

Hope you can find this useful, even if you can do what the library does without major effort, I aimed to bring it in a easy way for you.

Contributing

  1. Fork Updeto
  2. Create your feature branch
  3. Commit your changes, along with unit tests (Currently using Conventional Commits.)
  4. Push to the branch
  5. Create pull request

GitHub

link
Stars: 8
Last commit: 1 year ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

0.1.0
1 year ago

Changed

  • Added new case .developmentOrBeta to the AppStoreLookupResult in order to fix an issue where if the installed version is higher than the AppStore result it will throw .outdated.

Explanation of changes:

State that means installed version is higher than latest on AppStore. This is possible if the installed version is a development / beta build (eg. Xcode, TestFlight). Worst case scenario is that the response from apple is outdated, which is unlikely to happen.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics