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.0.2
✅ Update checker for iOS Apps
⭐️ 7
🕓 1 year ago
iOS
.package(url: "https://github.com/manasv/Updeto.git", from: "0.0.2")

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
    }
}

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: 7
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

0.0.2
1 year ago

Changed

  • Dropped boolean output to use fully enum based output, with these posible outcomes: updated, outdated and noResults

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