You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's some commented sample code. Adapt this to meet your app's needs. For a full list of optional settings/preferences, please refer to https://github.com/ArtSabintsev/Siren/blob/master/Sample%20App/Sample%20App/AppDelegate.swift in the Sample Project.
96
+
Below is some commented sample code. Adapt this to meet your app's needs.
97
+
98
+
For a full list of optional settings/preferences, please refer to https://github.com/ArtSabintsev/Siren/blob/master/SirenExample/SirenExample/AppDelegate.swift in the Sample Project.
/* Siren code should go below window?.makeKeyAndVisible() */
103
103
104
-
// Siren is a singleton
105
-
let siren = Siren.shared
104
+
// Siren is a singleton
105
+
let siren = Siren.shared
106
106
107
-
// Optional: Defaults to .Option
108
-
siren.alertType=<#SirenAlertType_Enum_Value#>
107
+
// Optional: Defaults to .Option
108
+
siren.alertType=<#SirenAlertType_Enum_Value#>
109
109
110
-
/*
111
-
Replace .Immediately with .Daily or .Weekly to specify a maximum daily or weekly frequency for version
112
-
checks.
113
-
*/
110
+
// Optional: Set this variable if you would only like to show an alert if your app has been available on the store for a few days.
111
+
// This default value is set to 1 to avoid this issue: https://github.com/ArtSabintsev/Siren#words-of-caution
112
+
// To show the update immediately after Apple has updated their JSON, set this value to 0. Not recommended due to aforementioned reason in https://github.com/ArtSabintsev/Siren#words-of-caution.
// Replace .Immediately with .Daily or .Weekly to specify a maximum daily or weekly frequency for version checks.
114
116
siren.checkVersion(checkType: .immediately)
115
117
116
118
returntrue
@@ -244,7 +246,7 @@ The App Store reviewer will **not** see the alert. The version in the App Store
244
246
## Words of Caution
245
247
Occassionally, the iTunes JSON will update faster than the App Store CDN, meaning the JSON may state that the new verison of the app has been release, while no new binary is made available for download via the App Store. It is for this reason, I caution developers to not use the `Force` option unless you are controlling the `Force` option with a remote configuration file (e.g., enabling Siren remotely only after you have guaranteed that the app has propogated to the App Store).
246
248
247
-
Also, on even rarer situations, the iTunes JSON may fluctuate between multiple versions of your app shortly after pushing out a new version. This is extremely rare, and has only been reported once in the five years of that Siren and Harpy have been around.
249
+
Also, in even rarer situations, the iTunes JSON may fluctuate between multiple versions of your app shortly after pushing out a new version. This is extremely rare, and has only been reported once in the five years that Siren and Harpy have been around.
Copy file name to clipboardexpand all lines: SirenExample/SirenExample/AppDelegate.swift
+8-6
Original file line number
Diff line number
Diff line change
@@ -31,9 +31,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
31
31
// Optional
32
32
siren.debugEnabled =true
33
33
34
-
// Optional
35
-
siren.appName ="Test App Name"
36
-
34
+
// Optional - Change the name of your app. Useful if you have a long app name and want to display a shortened version in the update dialog (e.g., the UIAlertController).
35
+
// siren.appName = "Test App Name"
36
+
37
37
// Optional - Defaults to .Option
38
38
// siren.alertType = .Option // or .Force, .Skip, .None
39
39
@@ -49,8 +49,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
49
49
// Optional - Set this variable if your app is not available in the U.S. App Store. List of codes: https://developer.apple.com/library/content/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Appendices/AppStoreTerritories.html
50
50
// siren.countryCode = ""
51
51
52
-
// Optional - Set this variable if you would only like to show an alert if your app has been available on the store for a few days. The number 5 is used as an example.
// Optional - Set this variable if you would only like to show an alert if your app has been available on the store for a few days.
53
+
// This default value is set to 1 to avoid this issue: https://github.com/ArtSabintsev/Siren#words-of-caution
54
+
// To show the update immediately after Apple has updated their JSON, set this value to 0. Not recommended due to aforementioned reason in https://github.com/ArtSabintsev/Siren#words-of-caution.
0 commit comments