Skip to content

Commit

Permalink
Re-enabled isUpdateCompatibleWithDeviceOS
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtSabintsev committed Oct 13, 2017
1 parent e235f46 commit 6d1e626
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
- [Ryoh Tsukahara](https://github.com/nixnoughtnothing) for [Pull Request #150](https://github.com/ArtSabintsev/Siren/pull/150)
- [Ryoh Tsukahara](https://github.com/nixnoughtnothing) for [Pull Request #159](https://github.com/ArtSabintsev/Siren/pull/159)
- [Jason Wade](https://github.com/iJasonWade) for [Pull Request #162](https://github.com/ArtSabintsev/Siren/pull/162)
- [JussiSuojanen](https://github.com/JussiSuojanen) for [Pull Request #171](https://github.com/ArtSabintsev/Siren/pull/171)

### Harpy Project Contributors
This repo is a Swift language port of [Harpy](http://github.com/ArtSabintsev/Harpy). We couldn't have built this port without acknowledging the following developers who were instrumental in getting Harpy to v3.2.1, the version of Harpy that Siren was based on.
Expand Down
12 changes: 8 additions & 4 deletions Sources/Siren.swift
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,10 @@ private extension Siren {
}

func processVersionCheck(with model: SirenLookupModel) {
storeVersionCheckDate() // Store version comparison date

guard isUpdateCompatibleWithDeviceOS(for: model) else {
return
}

guard let appID = model.results.first?.appID else {
postError(.appStoreAppIDFailure)
return
Expand Down Expand Up @@ -275,6 +277,8 @@ private extension Siren {
}

func showAlert() {
storeVersionCheckDate()

let updateAvailableMessage = Bundle.localizedString(forKey: "Update Available", forceLanguageLocalization: forceLanguageLocalization)
let newVersionMessage = localizedNewVersionMessage()

Expand Down Expand Up @@ -422,7 +426,7 @@ extension Siren {
return newVersionExists
}

fileprivate func storeVersionCheckDate() {
private func storeVersionCheckDate() {
lastVersionCheckPerformedOnDate = Date()
if let lastVersionCheckPerformedOnDate = lastVersionCheckPerformedOnDate {
UserDefaults.standard.set(lastVersionCheckPerformedOnDate, forKey: SirenDefaults.StoredVersionCheckDate.rawValue)
Expand All @@ -434,7 +438,7 @@ extension Siren {
// MARK: - Helpers (Misc.)

private extension Siren {
func isUpdateCompatibleWithDeviceOS(_ model: SirenLookupModel) -> Bool {
func isUpdateCompatibleWithDeviceOS(for model: SirenLookupModel) -> Bool {
guard let requiredOSVersion = model.results.first?.minimumOSVersion else {
postError(.appStoreOSVersionNumberFailure)
return false
Expand Down

0 comments on commit 6d1e626

Please sign in to comment.