Skip to content

Commit

Permalink
Imported version update fix from Harpy #108
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtSabintsev committed Dec 10, 2015
1 parent d1a9895 commit 4b251ce
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- [Tanel Suurhans](https://github.com/tanelsuurhans) and [Jaroslav_](https://github.com/jaroslavas) for [Pull Request #99 (Harpy)](https://github.com/ArtSabintsev/Harpy/issues/99)
- [Zaid M. Said](https://github.com/SentulAsia) for [Pull Request #36](https://github.com/ArtSabintsev/Siren/pull/36)
- [Vahan Margaryan](https://github.com/VahanMargaryan) for [Pull Request #37](https://github.com/ArtSabintsev/Siren/pull/37)
- [Justus Kandzi](https://github.com/jkandzi) for [Pull Request #108 (Harpy)](https://github.com/ArtSabintsev/Harpy/pull/108)

### 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
10 changes: 10 additions & 0 deletions Sample App/Sample App/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Required
siren.checkVersion(.Immediately)
}

func applicationWillEnterForeground(application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
Siren.sharedInstance.checkVersion(.Immediately)
}

func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
Siren.sharedInstance.checkVersion(.Daily)
}
}

extension AppDelegate: SirenDelegate
Expand Down
2 changes: 1 addition & 1 deletion Siren.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Siren"
s.version = "0.6.2"
s.version = "0.6.3"
s.summary = "Notify users when a new version of your iOS app is available, and prompt them with the App Store link.."

s.description = <<-DESC
Expand Down
4 changes: 2 additions & 2 deletions Siren/Siren.swift
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,9 @@ private extension Siren {
alertType = majorUpdateAlertType
} else if newVersion[1] > oldVersion[1] { // a.B.c.d
alertType = minorUpdateAlertType
} else if newVersion.count > 2 && newVersion[2] > oldVersion[2] { // a.b.C.d
} else if newVersion.count > 2 && (oldVersion.count <= 2 || newVersion[2] > oldVersion[2]) { // a.b.C.d
alertType = patchUpdateAlertType
} else if newVersion.count > 3 && newVersion[3] > oldVersion[3] { // a.b.c.D
} else if newVersion.count > 3 && (oldVersion.count <= 3 || newVersion[3] > oldVersion[3]) { // a.b.c.D
alertType = revisionUpdateAlertType
}
}
Expand Down

0 comments on commit 4b251ce

Please sign in to comment.