• Stars
    star
    4,140
  • Rank 10,457 (Top 0.3 %)
  • Language
    Swift
  • License
    MIT License
  • Created almost 10 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Notify users when a new version of your app is available and prompt them to upgrade.

Siren 🚨

Notify users when a new version of your app is available and prompt them to upgrade.

Swift Support CocoaPods SwiftPM Compatible Accio supported


Important Information

I stopped being a proactive iOS engineer in 2021. For the time being, I will keep this library maintained for the community, but I will not be proactively adding features.


Table of Contents


Meta

About

Siren checks a user's currently installed version of your iOS app against the version that is currently available in the App Store.

If a new version is available, a language localized alert can be presented to the user informing them of the newer version, and giving them the option to update the application. Alternatively, Siren can notify your app through alternative means, such as a custom user interface.

Siren is built to work with the Semantic Versioning system.

  • Canonical Semantic Versioning uses a three number versioning system (e.g., 1.0.0)
  • Siren also supports two-number versioning (e.g., 1.0) and four-number versioning (e.g., 1.0.0.0)

Features

Current Features


Screenshots

  • The left picture forces the user to update the app.
  • The center picture gives the user the option to update the app.
  • The right picture gives the user the option to skip the current update.
  • These options are controlled by the Rules.AlertType enum.

Ports

  • Objective-C (iOS)
    • Harpy
    • Siren was ported from Harpy, as Siren and Harpy are maintained by the same developer.
    • As of December 2018, Harpy has been deprecated in favor of Siren.
  • Java (Android)
  • React Native (iOS)

Installation and Integration

Installation Instructions

Swift Version Branch Name Will Continue to Receive Updates?
5.5+ master Yes
5.1-5.4 swift5.4 No
5.0 swift5.0 No
4.2 swift4.2 No
4.1 swift4.1 No
3.2 swift3.2 No
3.1 swift3.1 No
2.3 swift2.3 No

CocoaPods

pod 'Siren' # Swift 5.5+
pod 'Siren', :git => 'https://github.com/ArtSabintsev/Siren.git', :branch => 'swift5.4' # Swift 5.1-5.4
pod 'Siren', :git => 'https://github.com/ArtSabintsev/Siren.git', :branch => 'swift5.0' # Swift 5.0
pod 'Siren', :git => 'https://github.com/ArtSabintsev/Siren.git', :branch => 'swift4.2' # Swift 4.2
pod 'Siren', :git => 'https://github.com/ArtSabintsev/Siren.git', :branch => 'swift4.1' # Swift 4.1
pod 'Siren', :git => 'https://github.com/ArtSabintsev/Siren.git', :branch => 'swift3.2' # Swift 3.2
pod 'Siren', :git => 'https://github.com/ArtSabintsev/Siren.git', :branch => 'swift3.1' # Swift 3.1
pod 'Siren', :git => 'https://github.com/ArtSabintsev/Siren.git', :branch => 'swift2.3' # Swift 2.3

Swift Package Manager

.Package(url: "https://github.com/ArtSabintsev/Siren.git", majorVersion: 6)

Implementation Examples

Implementing Siren is as easy as adding two lines of code to your app in either AppDelegate.swift or SceneDelegate.swift:

AppDelegate.swift Example

import Siren // Line 1
import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
        window?.makeKeyAndVisible()

	Siren.shared.wail() // Line 2

        return true
    }
}

SceneDelegate.swift Example

import Siren // Line 1
import UIKit

class SceneDelegate: UIResponder, UIWindowSceneDelegate {

    var window: UIWindow?

    func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
        window?.makeKeyAndVisible()

	Siren.shared.wail() // Line 2

        return true
    }
}

Siren also has plenty of customization options. All examples can be found in the Example Project's AppDelegate file. Uncomment the example you'd like to test.


Device-Specific Checks

Localization

Siren is localized for the following languages:

Arabic, Armenian, Basque, Chinese (Simplified and Traditional), Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hebrew, Hungarian, Indonesian, Italian, Japanese, Korean, Latvian, Lithuanian, Malay, Norwegian (BokmΓ₯l), Persian (Afghanistan, Iran, Persian), Polish, Portuguese (Brazil and Portugal), Romanian, Russian, Serbian (Cyrillic and Latin), Slovenian, Spanish, Swedish, Thai, Turkish, Ukrainian, Urdu, Vietnamese

If your user's device is set to one of the supported locales, an update message will appear in that language. If a locale is not supported, than the message will appear in English.

You may want the update dialog to always appear in a certain language, ignoring the user's device-specific setting. You can enable it like so:

// In this example, we force the `Russian` language.
Siren.shared.presentationManager = PresentationManager(forceLanguageLocalization: .russian)

Device Compatibility

If an app update is available, Siren checks to make sure that the version of iOS on the user's device is compatible with the one that is required by the app update. For example, if a user has iOS 11 installed on their device, but the app update requires iOS 12, an alert will not be shown. This takes care of the false positive case regarding app updating.


Testing

Testing Siren Locally

Temporarily change the version string in Xcode (within the .xcodeproj file) to an older version than the one that's currently available in the App Store. Afterwards, build and run your app, and you should see the alert.

If you currently don't have an app in the store, change your bundleID to one that is already in the store. In the sample app packaged with this library, we use Facebook's Bundle ID: com.facebook.Facebook.

Words of Caution

Occasionally, the iTunes JSON will update faster than the App Store CDN, meaning the JSON may state that the new version of the app has been released, while no new binary is made available for download via the App Store. It is for this reason that Siren will, by default, wait 1 day (24 hours) after the JSON has been updated to prompt the user to update. To change the default setting, please modify the value of showAlertAfterCurrentVersionHasBeenReleasedForDays.


App Submission

App Store Review

The App Store reviewer will not see the alert. The version in the App Store will always be older than the version being reviewed.

Phased Releases

In 2017, Apple announced the ability to rollout app updates gradually (a.k.a. Phased Releases). Siren will continue to work as it has in the past, presenting an update modal to all users. If you opt-in to a phased rollout for a specific version, you have a few choices:

  • You can leave Siren configured as normal. Phased rollout will continue to auto-update apps. Since all users can still manually update your app directly from the App Store, Siren will ignore the phased rollout and will prompt users to update.
  • You can set showAlertAfterCurrentVersionHasBeenReleasedForDays to 7, and Siren will not prompt any users until the latest version is 7 days old, after the phased rollout is complete.
  • You can remotely disable Siren until the rollout is done using your own API / backend logic.

Attribution

Special Thanks

A massive shout-out and thank you goes to the following folks:

  • Aaron Brager for motivating me and assisting me in building the initial proof-of-concept of Siren (based on Harpy) back in 2015. Without him, Siren may never have been built.
  • All of Harpy's Contributors for helping building the feature set from 2012-2015 that was used as the basis for the first version of Siren.
  • All of Siren's Contributors for helping make Siren as powerful and bug-free as it currently is today.

Creator

Arthur Ariel Sabintsev

More Repositories

1

Harpy

Notify users when a new version of your app is available and prompt them to upgrade.
Objective-C
2,600
star
2

FontBlaster

Programmatically load custom fonts into your iOS, macOS and tvOS app.
Swift
1,135
star
3

Zephyr

Effortlessly synchronize UserDefaults over iCloud.
Swift
899
star
4

Guitar

A Cross-Platform String and Regular Expression Library written in Swift.
Swift
660
star
5

Solarized-Dark-for-Xcode

Solarized Dark Theme for Xcode. Compatible with all modern versions of Xcode since 2013!
Shell
366
star
6

UIFloatLabelTextField

A subclassed UITextField that follows the Float Label UI design pattern.
Objective-C
323
star
7

Magic

A Swift alternative for Objective-C's DLog macro.
Ruby
283
star
8

UIFloatLabelTextView

A subclassed UITextView that follows the Float Label UI design pattern.
Objective-C
174
star
9

Freedom

The Freedom to Open URLs in Third-Party Browsers on iOS with Custom UIActivity Subclasses.
Swift
86
star
10

Asynchronous-Freeloader

Multithreaded Asynchronous Image Downloader
Objective-C
22
star
11

Cognac

An Alluring, Dark, and Muted Theme For Your Favorite Text Editor.
16
star
12

Cognac-Xcode

An Alluring, Dark, and Muted Theme For Xcode.
Shell
14
star
13

GitFame

A Swift CLI script that logs your GitHub Stars and Forks.
Makefile
13
star
14

MaterialSwitch

A Material Design inspired switch for iOS
Swift
12
star
15

UIDevice-SupportedDevices

An Objective-C category on UIDevice that returns devices based on the supportedDevices key in the JSON results returned in an iTunes Lookup API call.
Objective-C
12
star
16

UIView-AutoLayoutView

A small Objective-C category on UIView that creates a UIView object that is ready to be used in programmatic AutoLayout.
Objective-C
9
star
17

UIColor-ColorWithHexAndAlpha

A category on UIColor that enables you to use hex values to create UIColor objects.
Objective-C
8
star
18

iOSDevCampDC-2018

My talk on Scaling iOS Architecture for iOSDevCampDC 2018.
5
star
19

Panhandler

Remind your active users to rate and review your iOS app
Objective-C
5
star
20

Cognac-iTerm

An Alluring, Dark, and Muted Syntax Theme For iTerm2.
3
star
21

Cognac-VSCode

An Alluring, Dark, and Muted Syntax Theme For Visual Studio Code.
3
star
22

artsabintsev.github.io

My Homepage.
CSS
2
star
23

NSDate-DateFromBSONObjectID

Convert MongoDB's BSON ObjectID to NSDate
Objective-C
2
star
24

Swift-3-CocoaHeads-DC-Talk

My talk on Swift 3 at CocoaHeads DC on July 7, 2016.
Swift
2
star
25

iOSDevCampDC-2017

My Talk on Open Source Software Development for iOSDevCampDC 2017.
2
star
26

cocoaheads-ukraine-2017

My Talk on Open Source Software Development for CocoaHeads Ukraine #13 in 2017
1
star
27

Apple-Watch-WatchKit-CocoaHeads-DC-Talk-

Keynote, PDF, and Sample Project for my WatchKit Talk.
Swift
1
star
28

Cognac-Terminal

An Alluring, Dark, and Muted Theme For The macOS Terminal.
1
star
29

Simple-Class-Portraits

A simple addon for World of Warcraft.
Lua
1
star