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

Overview

After 6 years of Harpy and 4 years of Siren, I have decided to deprecate Harpy in favor of Siren. Why? Siren is written in Swift and has a feature set that is superior to that of Harpy. More information can be found on this Medium post. The repository will live on, however, there will be no further updates and no transfers of the codebase at this time.


Harpy

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

Build Status

CocoaPods Carthage Compatible CocoaPods


About

Harpy 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, an alert can be presented to the user informing them of the newer version, and giving them the option to update the application.

Harpy is built to work with the Semantic Versioning system.

  • Semantic Versioning is a three number versioning system (e.g., 1.0.0)
  • Harpy also supports two-number versioning (e.g., 1.0)
  • Harpy also supports four-number versioning (e.g., 1.0.0.0)
  • Harpy only works with numbers.

Swift Support

Harpy was ported to Swift by myself and Aaron Brager. We've called the new project Siren.

Features

  • CocoaPods Support
  • Carthage Support
  • Localized for 40+ languages (See Localization)
  • Pre-Update Device Compatibility Check (See Device Compatibility)
  • Three types of alerts (see Screenshots & Alert Types)
  • Optional delegate methods (see Optional Delegate section)
  • Unit Tests!

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 HarpyAlertType enum that is found in Harpy.h.

Installation Instructions

CocoaPods

pod 'Harpy'

Carthage

github "ArtSabintsev/Harpy"

Manual

Copy the 'Harpy' folder into your Xcode project. It contains the Harpy.h and Harpy.m files.

Setup

  1. Import Harpy.h into your AppDelegate or Pre-Compiler Header (.pch)
  2. In your AppDelegate, optionally set the alertType.
  3. In your AppDelegate, call only one of the checkVersion methods, as all three perform a check on your application's first launch. Use either:
    • checkVersion in application:didFinishLaunchingWithOptions:
    • checkVersionDaily in applicationDidBecomeActive:.
    • checkVersionWeekly in applicationDidBecomeActive:.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

	// Present Window before calling Harpy
	[self.window makeKeyAndVisible];

	// Set the UIViewController that will present an instance of UIAlertController
	[[Harpy sharedInstance] setPresentingViewController:_window.rootViewController];

    // (Optional) Set the Delegate to track what a user clicked on, or to use a custom UI to present your message.
        [[Harpy sharedInstance] setDelegate:self];

    // (Optional) When this is set, the alert will only show up if the current version has already been released for X days.
    // By default, this value is set to 1 (day) to avoid an issue where Apple updates the JSON faster than the app binary propogates to the App Store.
        [[Harpy sharedInstance] setShowAlertAfterCurrentVersionHasBeenReleasedForDays:3];

	// (Optional) The tintColor for the alertController
	[[Harpy sharedInstance] setAlertControllerTintColor:@"<#alert_controller_tint_color#>"];

	// (Optional) Set the App Name for your app
	[[Harpy sharedInstance] setAppName:@"<#app_name#>"];

	/* (Optional) Set the Alert Type for your app
	 By default, Harpy is configured to use HarpyAlertTypeOption */
	[[Harpy sharedInstance] setAlertType:<#alert_type#>];

	/* (Optional) If your application is not available in the U.S. App Store, you must specify the two-letter
	 country code for the region in which your applicaiton is available. */
	[[Harpy sharedInstance] setCountryCode:@"<#country_code#>"];

	/* (Optional) Overrides system language to predefined language.
	 Please use the HarpyLanguage constants defined in Harpy.h. */
	[[Harpy sharedInstance] setForceLanguageLocalization:<#HarpyLanguageConstant#>];

        /* (Optional): Delays the update prompt by a specific number of days. By default,
	this value is set to 1 day to avoid an issue where Apple updates the JSON faster than the app binary propogates to the App Store.*/
        [[Harpy sharedInstance] setShowAlertAfterCurrentVersionHasBeenReleasedForDays:<#Int#>];

	// Perform check for new version of your app
	[[Harpy sharedInstance] checkVersion];
}

- (void)applicationDidBecomeActive:(UIApplication *)application {

	/*
	 Perform daily check for new version of your app
	 Useful if user returns to you app from background after extended period of time
 	 Place in applicationDidBecomeActive:

 	 Also, performs version check on first launch.
 	*/
	[[Harpy sharedInstance] checkVersionDaily];

	/*
	 Perform weekly check for new version of your app
	 Useful if you user returns to your app from background after extended period of time
	 Place in applicationDidBecomeActive:

	 Also, performs version check on first launch.
	 */
	[[Harpy sharedInstance] checkVersionWeekly];

}

- (void)applicationWillEnterForeground:(UIApplication *)application {
	/*
	 Perform check for new version of your app
	 Useful if user returns to you app from background after being sent tot he App Store,
	 but doesn't update their app before coming back to your app.

 	 ONLY USE THIS IF YOU ARE USING *HarpyAlertTypeForce*

 	 Also, performs version check on first launch.
 	*/
	[[Harpy sharedInstance] checkVersion];
}

And you're all set!

Differentiated Alerts for Patch, Minor, and Major Updates

If you would like to set a different type of alert for revision, patch, minor, and/or major updates, simply add one or all of the following optional lines to your setup before calling any of the checkVersion methods:

	/* By default, Harpy is configured to use HarpyAlertTypeOption for all version updates */
	[[Harpy sharedInstance] setPatchUpdateAlertType:<#alert_type#>];
	[[Harpy sharedInstance] setMinorUpdateAlertType:<#alert_type#>];
	[[Harpy sharedInstance] setMajorUpdateAlertType:<#alert_type#>];
	[[Harpy sharedInstance] setRevisionUpdateAlertType:<#alert_type#>];

Optional Delegate and Delegate Methods

If you'd like to handle or track the end-user's behavior, four delegate methods have been made available to you:

	// User presented with update dialog
	- (void)harpyDidShowUpdateDialog;

	// User did click on button that launched App Store.app
	- (void)harpyUserDidLaunchAppStore;

	// User did click on button that skips version update
	- (void)harpyUserDidSkipVersion;

	// User did click on button that cancels update dialog
	- (void)harpyUserDidCancel;

If you would like to use your own UI, please use the following delegate method to obtain the localized update message if a new version is available:

- (void)harpyDidDetectNewVersionWithoutAlert:(NSString *)message;

Localization

Harpy is localized for

  • 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 (Iran, Afghanistan, Persian)
  • Polish
  • Portuguese (Brazil and Portugal)
  • Russian
  • Serbian (Cyrillic and Latin)
  • Slovenian
  • Spanish
  • Swedish
  • Thai
  • Turkish
  • Ukrainian
  • Urdu
  • Vietnamese

You may want the update dialog to always appear in a certain language, ignoring iOS's language setting (e.g. apps released in a specific country).

You can enable it like this:

[[Harpy sharedInstance] setForceLanguageLocalization<#HarpyLanguageConstant#>];

Device Compatibility

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

Testing Harpy

Temporarily change the version string in Xcode (within the .xcodeproj) 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 the App Store Connect app's bundleID: com.apple.itunesconnect.mobile.

Important Note on App Store Submissions

The App Store reviewer will not see the alert.

Phased Releases

In 2017, Apple announced the ability to rollout app updates gradually (a.k.a. Phased Releases). Harpy 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 will need to remotely disable Harpy until the rollout is done.

Created and maintained by

Arthur Ariel Sabintsev

Comments
  • Change NSCalendarUnitDay to NSDayCalendarUnit

    Change NSCalendarUnitDay to NSDayCalendarUnit

    This should be a fix for issue #36 which prevented submission to CocoaPods.

    See here: https://travis-ci.org/CocoaPods/Specs/builds/12498782#L155

    It looks like it might be a better option to use NSDayCalendarUnit instead of NSCalendarUnitDay even though the former is deprecated.

    opened by plackemacher 12
  • Introduce AlertTypeNone, enableDebug and forceAlert

    Introduce AlertTypeNone, enableDebug and forceAlert

    This PR enables:

    • AlertTypeNone: in our case we don't want to have an alert for Patch update only for Minor and Major
    • setEnableDebug: this logs the json & URL used to connect to the iTunes store. Handy if you are tracking why it can't be find a version
    • setForceAlert: sometimes you want to see the alert regardless what your app version in the appstore is. This allows you to force this. Handy if no version are in the Store yet.
    opened by jedi4ever 8
  • Added canOpenURL verification, NSLocalizedStringFromTable method for make translations easier and spanish translation

    Added canOpenURL verification, NSLocalizedStringFromTable method for make translations easier and spanish translation

    • Added canOpenURL verification for check if the device can open Safari (iTunes).
    • Added NSLocalizedStringFromTable method for make translations easier.
    • Added spanish translation files and the default english translation file.
    New Feature 
    opened by alexruperez 8
  • Ability to reset skip version status.

    Ability to reset skip version status.

    I wanted to use combination of Harpy and our own server controlled way of forcing user to update the app, and I needed to reset the skipped version status for it. There are a lot of other ways to go by this, like exposing alert method or writing our own method but I thought it would be a good addition to API.

    opened by kamrankhan07 7
  • Added two new methods:

    Added two new methods:

    I wanted a persistent message that tells users if a newer version is available. For example, in the Settings page of my app, I show the current version of the app. I wanted to show if a newer version is available, and if yes, have a non-modal option to go to the AppStore. Something like the image below.

    ios simulator screen shot may 24 2015 9 54 30 pm

    Current implementation of Harpy didn't allow me that. Hence I added two new methods. Maybe others will find them useful too?

    1. [[Harpy sharedInstance] newVersionAvailable] - Returns YES/NO boolean value to tell if a new version is available. Uses a stored value from NSUserDefaults.
    2. [[Harpy sharedInstance] launchAppStore] - Launches the AppStore for the app.
    opened by rahuljiresal 7
  • Cocoapods fix

    Cocoapods fix

    Fixes #8 cocoapods build issues:

    Stack dump:
    0.  :4:1: current parser token 'void'
    /System/Library/BridgeSupport/ruby-1.8/bridgesupportparser.rb:960: [BUG] Segmentation fault
    ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
    

    Don't forget to tag the new 2.3.2 version.

    Bug 
    opened by markrickert 7
  • Added property to set the template used to build the lookup URL.

    Added property to set the template used to build the lookup URL.

    I'm not sure if this is the best approach, but the lookup comes up empty if the app is not available in the US Store.

    Commit Message

    In order to allow querying for apps that may not be available on the US Store. For example, the base string for lookup for Dutch-only apps is "http://itunes.apple.com/nl/lookup?id=%@".

    New Feature Research Question 
    opened by jamiely 6
  • Singleton and Localization

    Singleton and Localization

    Thanks for this great project!

    I've made a couple changes that I hope you'll like.

    The first main change is I made Harpy a singleton with a sharedInstance method. This allows the appID and alertType to be set without having to modify the constants header. In-fact I removed this header file completely. The reason for this is that having to modify files in the repo make it difficult to use git submodules. This should fix #18.

    The second change moves the strings into a localizable file. This also fixes #16 but in a slightly different way.

    New Feature 
    opened by kgn 6
  • Now supports different AlertTypes for major, minor and patch updates.

    Now supports different AlertTypes for major, minor and patch updates.

    I created support for different AlertTypes for different updates. These are the default options, and can be changed using the following. [[Harpy sharedInstance] setMajorUpdateAlertType:HarpyAlertTypeOption]; [[Harpy sharedInstance] setMinorUpdateAlertType:HarpyAlertTypeForce]; [[Harpy sharedInstance] setPatchUpdateAlertType:HarpyAlertTypeOption];

    (e.g. Major=2.0, Minor=2.1, Patch=2.1.1)

    New Feature 
    opened by rahuljiresal 5
  • Adds a new optional parameter to set the app name

    Adds a new optional parameter to set the app name

    I needed this because my bundle name was just an abbreviation of the real App name and I want to show the whole app title.

    This might be useful for someone else too.

    New Feature 
    opened by thomashempel 5
  • Adding Brazilian Portuguese localization and correcting European Portuguese

    Adding Brazilian Portuguese localization and correcting European Portuguese

    Adding the Brazilian Portuguese localization as pt, and renaming the European variant to pt-PT as per Apple Docs.

    The language ID for scripts or dialects uses subtags, as in pt-PT where pt is the code for Portuguese and PT is the code for Portugal. For example, use pt as the language ID for Portuguese as it is used in Brazil and pt-PT as the language ID for Portuguese as it is used in Portugal. The Other submenu (at the bottom of the list) contains more languages and dialects.

    opened by ipedro 4
Releases(4.1.14)
Owner
Arthur Ariel Sabintsev
Senior Engineering Manager
Arthur Ariel Sabintsev
AppVersion - Keep users on the up-to date version of your App.

?? App Version Don't let you users to get stuck on outdated version of your app. Automatic update tracking using Semantic Versioning Buil-in UI alerts

Ameba Labs 31 Sep 30, 2022
Appirater - A utility that reminds your iPhone app's users to review the app.

Introduction Appirater is a class that you can drop into any iPhone app (iOS 4.0 or later) that will help remind your users to review your app on the

Arash Payan 4.7k Jan 7, 2023
Apphud SDK is a lightweight open-source Swift library to manage auto-renewable subscriptions and other in-app purchases in your iOS app.

Apphud SDK Apphud SDK is a lightweight open-source Swift library to manage auto-renewable subscriptions and other in-app purchases in your iOS app. No

Apphud 143 Dec 16, 2022
An easy way to access reviews for your app instead of writing repetitive and redundant codes for every app.

AppStoreReviewManager An easy way to access reviews for your app instead of writing repetitive and redundant codes for every app. Requirements iOS 9.0

Jinya 4 Dec 23, 2022
🍎 An App to check whether a non-App Store app is in App Store.

AppStorify ?? An App to check whether a non-App Store app is in App Store. Benfits Use App Store's upgrade mechanism instead of app's. App Store apps

seedgou 58 Dec 7, 2022
Appstore-Review-Guidelines - A curated list of guideline which has to be taken care before submitting your application to Appstore.

Appstore Review Guidelines The App Review Guidelines provide rules and examples across a range of topics, including user interface design, functionali

Aashish Tamsya 14 Dec 16, 2022
Apple's Framework to support in-app purchases and interaction with the App Store

Apple's Framework to support in-app purchases and interaction with the App Store.

paigeshin 0 Dec 5, 2021
InAppPurchase - A Simple and Lightweight framework for In App Purchase

InAppPurchase A Simple, Lightweight and Safe framework for In App Purchase Feature Simple and Light ?? Support Promoting In-App Purchases ?? No need t

Jin Sasaki 269 Dec 15, 2022
SwiftyStoreKit is a lightweight In App Purchases framework for iOS, tvOS, watchOS, macOS, and Mac Catalyst ⛺

SwiftyStoreKit is a lightweight In App Purchases framework for iOS, tvOS, watchOS, macOS, and Mac Catalyst. Features Super easy-to-use block-based API

Andrea Bizzotto 6.1k Jan 7, 2023
Mercato is a lightweight In-App Purchases (StoreKit 2) library for iOS, tvOS, watchOS, macOS, and Mac Catalyst.

Mercato Mercato is a lightweight In-App Purchases (StoreKit 2) library for iOS, tvOS, watchOS, macOS, and Mac Catalyst. Installation Swift Package Man

Pavel T 49 Jan 4, 2023
An App where you can find product and see its detail.

MeliProductos Project ???? > An App where you can find product and see its detail. ???? > Una App donde puedes encontrar tus productos y ver su detall

Joaquin Segovia 3 May 6, 2022
MerchantKit - A modern In-App Purchases management framework for iOS developers

MerchantKit dramatically simplifies the work indie developers have to do in order to add premium monetizable components to their applications. Track purchased products, offer auto-renewing subscriptions, restore transactions, and much more.

Benjamin Mayo 1.1k Dec 17, 2022
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. Table of Contents Meta About Features Screenshots Ports

Arthur Ariel Sabintsev 4.1k Dec 27, 2022
Siren - 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. Table of Contents Meta About Features Screenshots Ports

Arthur Ariel Sabintsev 4.1k Dec 27, 2022
Alert popup to notify your users if they use an unsupported iOS version

UnsupportedOSVersionAlert This source code alerts your users if they use your app with an unsupported version of iOS (e.g. iOS 10.0 beta). The alert l

Josef Moser 8 Mar 11, 2019
A framework to provide logic designed to prompt users at the ideal moment for a review of your app/software

ReviewKit ReviewKit is a Swift package/framework that provides logic designed to prompt users at the ideal moment for a review of your app. At a basic

Simon Mitchell 25 Jun 7, 2022
Silent Rock app: to notify users when approaching silent rock

silent-rock Silent Rock app - to notify users when approaching silent rock. Capstone Concept - Michelle Bodart Team members none Problem Statement #1

null 0 Jan 4, 2022
ReleaseNotesKit - a brand new, elegant, and extremely simple way to present the recent version’s release notes to your users

ReleaseNotesKit This is ReleaseNotesKit, a brand new, elegant, and extremely simple way to present the recent version’s release notes to your users. R

Swapnanil Dhol 22 Jun 30, 2022
A blog project where you can write your articles, upload photos, categorize them, and add them to your favorites

A blog project where you can write your articles, upload photos, categorize them, and add them to your favorites. The aim of the project is to learn the use of Core Data.

Cem 7 Mar 21, 2022