Otok public index

apotocki/updates

Checks the App Store for a newer version of the app and prompts the user to update.

Library
updates
Newest
2.0.2 (r1, apple)
Targets
apple
License
MIT
Homepage
https://github.com/rwbutler/Updates
Keywords
app-store, updates, swift

Use it

In otok.toml:

[deps.updates]
recipe = "apotocki/updates"
version = "~> 2.0.2"

Versions

VersionTargetChannelPublishedStatus
2.0.2 (r1, apple) apple stable 2026-11-07

2.0.2 (r1, apple)

Platforms

ios, iossim, macosx, catalyst

Recipe files

patches/0001-itunes-https.patch 912 bytes · raw
diff --git a/Updates/Classes/Services/App Metadata/Implementation/ITunesSearchAPIService.swift b/Updates/Classes/Services/App Metadata/Implementation/ITunesSearchAPIService.swift
index 376a7ac..93e2d1f 100644
--- a/Updates/Classes/Services/App Metadata/Implementation/ITunesSearchAPIService.swift	
+++ b/Updates/Classes/Services/App Metadata/Implementation/ITunesSearchAPIService.swift	
@@ -17,7 +17,7 @@ struct ITunesSearchAPIService: AppMetadataService {
 
     init?(bundleIdentifier: String, countryCode: String) {
         let lowercasedCountryCode = countryCode.lowercased()
-        let urlString = "http://itunes.apple.com/lookup?bundleId=\(bundleIdentifier)&country=\(lowercasedCountryCode)"
+        let urlString = "https://itunes.apple.com/lookup?bundleId=\(bundleIdentifier)&country=\(lowercasedCountryCode)"
         guard let url = URL(string: urlString) else {
             return nil
         }
patches/0002-ui-for-uikit.patch 1435 bytes · raw
diff --git a/Package.swift b/Package.swift
index 61986fb..2f1c9c2 100644
--- a/Package.swift
+++ b/Package.swift
@@ -18,7 +18,6 @@ let package = Package(
             name: "Updates",
             dependencies: [],
             path: "Updates/Classes",
-            exclude: ["UI"],
             resources: [.copy("../../Example/Pods/Target Support Files/Updates/PrivacyInfo.xcprivacy")]
         )
     ]
diff --git a/Updates/Classes/UI/Updates+UIDevice.swift b/Updates/Classes/UI/Updates+UIDevice.swift
index 28466c2..f8ffbfd 100644
--- a/Updates/Classes/UI/Updates+UIDevice.swift
+++ b/Updates/Classes/UI/Updates+UIDevice.swift
@@ -5,6 +5,8 @@
 //  Created by Ross Butler on 8/8/19.
 //
 
+// UIKit only: the package also builds for macOS, which these files are not for (otok recipe patch)
+#if canImport(UIKit)
 import Foundation
 import UIKit
 
@@ -15,3 +17,4 @@ public extension Updates {
     }
     
 }
+#endif
diff --git a/Updates/Classes/UI/UpdatesUI.swift b/Updates/Classes/UI/UpdatesUI.swift
index f3f4ca7..446f4ae 100644
--- a/Updates/Classes/UI/UpdatesUI.swift
+++ b/Updates/Classes/UI/UpdatesUI.swift
@@ -5,6 +5,8 @@
 //  Created by Ross Butler on 12/27/18.
 //
 
+// UIKit only: the package also builds for macOS, which these files are not for (otok recipe patch)
+#if canImport(UIKit)
 import Foundation
 import StoreKit
 import SafariServices
@@ -248,3 +250,4 @@ private extension UpdatesUI {
     }
     
 }
+#endif
recipe.toml 978 bytes · raw
[recipe]
api = 1
library = "updates"
name = "updates"
version = "2.0.2"
revision = 1
license = "MIT"
license-files = ["LICENSE"]
description = "Checks the App Store for a newer version of the app and prompts the user to update."
homepage = "https://github.com/rwbutler/Updates"
keywords = ["app-store", "updates", "swift"]

# Unmaintained upstream: the App Store lookup goes over http://, which App Transport Security blocks (0001);
# Package.swift leaves out the UI (UpdatesUI, checkForUpdates without an OS version), which CocoaPods
# had, because the package also builds for macOS: 0002 takes it in behind canImport(UIKit).
[source]
git = "https://github.com/rwbutler/Updates"
commit = "388bc6369ca5b83a41b77743d8a62902b6ff7ef3"
tag = "2.0.2"
patches = ["patches/0001-itunes-https.patch", "patches/0002-ui-for-uikit.patch"]

[platforms]
supported = ["ios", "iossim", "macosx", "catalyst"]
build-on = ["macos/xcode"]

[apple]
swift-package = "."

[[product]]
name = "Updates"