Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

Commit

Permalink
feat(ios): expose minimumOsVersion (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
robingenz authored Dec 15, 2021
1 parent b8e6972 commit 1b8fe82
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ Only available for Android.
| **`flexibleUpdateAllowed`** | <code>boolean</code> | `true` if a flexible update is allowed, otherwise `false`. Only available for Android. |
| **`clientVersionStalenessDays`** | <code>number</code> | Number of days since the Google Play Store app on the user's device has learnt about an available update if an update is available or in progress. Only available for Android. |
| **`installStatus`** | <code><a href="#flexibleupdateinstallstatus">FlexibleUpdateInstallStatus</a></code> | Flexible in-app update install status. Only available for Android. |
| **`minimumOsVersion`** | <code>string</code> | The minimum version of the operating system required for the app to run in iOS. Only available for iOS. |


#### GetAppUpdateInfoOptions
Expand Down
6 changes: 4 additions & 2 deletions ios/Plugin/AppUpdatePlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public class AppUpdatePlugin: CAPPlugin {
let json = try JSONSerialization.jsonObject(with: data, options: [.allowFragments]) as? [String: Any],
let result = (json["results"] as? [Any])?.first as? [String: Any],
let availableVersion = result["version"] as? String,
let availableVersionReleaseDate = result["currentVersionReleaseDate"] as? String
let availableVersionReleaseDate = result["currentVersionReleaseDate"] as? String,
let minimumOsVersion = result["minimumOsVersion"] as? String
else {
call.reject("Required app information could not be fetched")
return
Expand All @@ -44,7 +45,8 @@ public class AppUpdatePlugin: CAPPlugin {
"currentVersion": currentVersion,
"availableVersion": availableVersion,
"availableVersionReleaseDate": availableVersionReleaseDate,
"updateAvailability": updateAvailability
"updateAvailability": updateAvailability,
"minimumOsVersion": minimumOsVersion
])
} catch let error {
call.reject(error.localizedDescription)
Expand Down
6 changes: 6 additions & 0 deletions src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ export interface AppUpdateInfo {
* Only available for Android.
*/
installStatus?: FlexibleUpdateInstallStatus;
/**
* The minimum version of the operating system required for the app to run in iOS.
*
* Only available for iOS.
*/
minimumOsVersion?: string;
}

export enum AppUpdateAvailability {
Expand Down

0 comments on commit 1b8fe82

Please sign in to comment.