PrinceOfVersions 4.0 is the latest major release of PrinceOfVersions, library used for checking for updates using configurations from some other source.
-
Multiple configurations:
- It is possible to define multiple configuration for the same platform
- Appropriate configuration will be chosen based on the requirements - if defined in JSON
-
Defining requirements:
- Requirements are conditions that have to be met for a configuration to be chosen
- It is not mandatory for a configuration to have requirements
- User can decide whatever requirement they think it's necessary
addRequirement
method used to provide requirement check closurerequired_os_version
built-in support for checking if required OS version requirement is met as long it is defined in JSON
-
Supporting older versions
- If you decide to upgrade PoV to version >= 4.0, both type of users (the ones who have app version with PoV < 4.0 and the ones who have app version with PoV >= 4.0) can be supported with only one JSON, for more information, please check out JSON Formatting section.
-
JSON Formatting
- JSON formatting has changed, see more here
- PoV version 4.0 will only work with the v2 version of JSON. Update the JSON file at the same time with the PoV.
-
Methods
-
Both
checkForUpdates
andloadConfiguration
methods are now unified in one methodcheckForUpdates
. -
All methods are now
static
. -
Return type of new
checkForUpdates
method isUpdateResult
(see more info under Return types). -
Achieving behaviour from old
checkForUpdates
andloadConfiguration
:- Return type
UpdateInfo
inloadConfiguration
can be found as a property inUpdateResult
struct. - Closures that were available in old
checkForUpdates
method have been replaced byUpdateStatus
enum (see more info under New Features) which can also be found inUpdateResult
struct under propertyupdateStatus
.
- Return type
-
-
Return types
-
Each method for checking whether update exists comes with compatible return type (
UpdateResult
,AppStoreUpdateResult
). -
Each return type, in addition to its essential properties
updateStatus
,updateVersion
,updateInfo
, possesses some unique properties specialised for method of getting versioning info. -
UpdateResult
- New return type which contains all information necessary for the update, to use previous
UpdateInfo
just accessupdateInfo
property on returnedUpdateResult
struct. - Used when getting the versioning information from JSON.
metadata
returns global metadata defined in JSON joined with metadata from the chosen configuration.
- New return type which contains all information necessary for the update, to use previous
-
AppStoreUpdateResult
- Used when getting the versioning information from the AppStore Connect.
phaseReleaseInProgress
returns bool value if phased release period is in progress.
-
-
Added parameter
notificationFrequency
tocheckForUpdateFromAppStore
method which is used for setting desired update notification frequency. -
UpdateStatus
- New enum which determines if update exists and if it is mandatory.
- Contained in
UpdateResult
struct. - Replaces closures in old
checkForUpdates
method. - Possible values are
noUpdateAvailable
,requiredUpdateNeeded
,newUpdateAvailable
.