Interface IAppApi
- Namespace
- VpnHood.AppLib.Api
- Assembly
- VpnHood.AppLib.Api.dll
Represents the app's API: its information, state and settings, the VPN's connect and disconnect, the split tunneling, the update, the ads and the remote access.
public interface IAppApi
Remarks
A UI reaches it in the app's process or over HTTP alike (VpnHoodApi). In process, a failure comes as the exception the app threw. Over HTTP, it comes as the same type where the app threw one the transport rebuilds: OperationCanceledException, TaskCanceledException, AlreadyExistsException, NotExistsException, UnauthorizedAccessException, TimeoutException or InvalidOperationException; any other comes as an ApiException that names it. A call that cannot reach the app fails with HttpRequestException.
Methods
ClearLastError(CancellationToken)
Clears the last error the state shows, as the person has seen it, and ends the diagnose mode's request.
Task ClearLastError(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
ClearReconnectRequired(CancellationToken)
Clears the state's request to reconnect for a changed setting, as the person has seen it.
Task ClearReconnectRequired(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that represents the asynchronous operation.
Remarks
A later change that needs a reconnect raises it again.
Exceptions
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
CompleteUpdate(CancellationToken)
Installs the downloaded update, as the person's Install.
Task CompleteUpdate(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that represents the asynchronous operation.
Remarks
On Android it needs the app's window, and fails without it, as the app's UiContextNotAvailableException.
Exceptions
- InvalidOperationException
No newer release is known, or it is not downloaded.
- NotSupportedException
The app has no updater, or its updater has a screen of its own or cannot update this copy.
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
Configure(ConfigParams, CancellationToken)
Sets what the UI gives the app: the languages it offers and its words for the app's own text.
Task<AppInfo> Configure(ConfigParams configParams, CancellationToken cancellationToken)
Parameters
configParamsConfigParamsThe UI's languages and words; a word it does not give keeps the app's own.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
Exceptions
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
Connect(Guid?, string?, ConnectPlanId, CancellationToken)
Connects the VPN, ending a connection under way first.
Task Connect(Guid? vpnProfileId, string? serverLocation, ConnectPlanId planId, CancellationToken cancellationToken)
Parameters
vpnProfileIdGuid?The VPN profile to connect with, or null for the current one.
serverLocationstringThe server location to connect to, or null for the profile's.
planIdConnectPlanIdThe plan to connect on, as one a rewarded ad pays for.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that completes once the VPN is connected.
Remarks
Unless the app is installing an update, it clears the last error first, and a connect applies every pending change
of the settings. A failed connect throws the app's error: the server's refusal (the app's
SessionException), the VPN service's failure, an ad the session required that failed (the app's ad
exceptions), or the system's own VPN failure, as where there is no window to ask for the VPN permission. The state
keeps it as its last error, but for a refusal while the app installs an update, which leaves the last error as it
was, and a connect a newer one replaced. A token canceled while the connect runs may come as
NoInternetException, as the check after the failure finds no internet.
Exceptions
- TimeoutException
The connection did not come up in the app's connect time, as the app's
ConnectionTimeoutException; the VPN service did not start in time; or the system's VPN permission prompt was not answered.- PremiumOnlyException
Always-on is for premium only, and the connect was always-on's.
- NoInternetException
A check after a failed connect found the device without internet.
- InvalidOperationException
The split by country has no IP location data, or no known country; or the client connected with no session.
- NotExistsException
No VPN profile is given and none is set, or the profile does not exist.
- AppUpdatingException
The app is installing an update.
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
A disconnect ended the connect, or the person refused the system's VPN permission, as the app's
UserCanceledException; orcancellationTokenwas canceled, over HTTP, or while the connect waited for a disconnect.
Diagnose(Guid?, string?, ConnectPlanId, CancellationToken)
Connects the VPN as Connect(Guid?, string?, ConnectPlanId, CancellationToken) does, in the diagnose mode.
Task Diagnose(Guid? vpnProfileId, string? serverLocation, ConnectPlanId planId, CancellationToken cancellationToken)
Parameters
vpnProfileIdGuid?The VPN profile to connect with, or null for the current one.
serverLocationstringThe server location to connect to, or null for the profile's.
planIdConnectPlanIdThe plan to connect on, as one a rewarded ad pays for.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that completes once the VPN is connected.
Remarks
It checks the server's addresses and the device's internet before it connects, and the traffic through the VPN
after, so a failure tells where the trouble is; it gives the connect three times as long, and logs more. Unless the
app is installing an update, it clears the last error first. A failed connect throws the app's error: the server's refusal (the app's
SessionException), the VPN service's failure, an ad the session required that failed (the app's ad
exceptions), or the system's own VPN failure, as where there is no window to ask for the VPN permission. The state
keeps it as its last error, but for a refusal while the app installs an update, which leaves the last error as it
was, and a connect a newer one replaced. A token canceled during the internet check
before the connect may come as NoInternetException.
Exceptions
- TimeoutException
The connection did not come up in the app's connect time, as the app's
ConnectionTimeoutException; the VPN service did not start in time; or the system's VPN permission prompt was not answered.- PremiumOnlyException
Always-on is for premium only, and the connect was always-on's.
- NoStableVpnException
Traffic does not go through the connected VPN.
- NoInternetException
The device has no internet.
- InvalidOperationException
The access key names no server address or host; the split by country has no IP location data, or no known country; or the client connected with no session.
- NotExistsException
No VPN profile is given and none is set, or the profile does not exist.
- AppUpdatingException
The app is installing an update.
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
A disconnect ended the connect, or the person refused the system's VPN permission, as the app's
UserCanceledException; orcancellationTokenwas canceled, over HTTP, or while the connect waited for a disconnect.
Disconnect(CancellationToken)
Disconnects the VPN.
Task Disconnect(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that completes once the disconnect has run.
Remarks
A VPN service that fails to stop is logged, not thrown: the task completes all the same.
Exceptions
- NotSupportedException
On Linux, the kill switch needs nft and cgroup v2, and the system lacks one.
- InvalidOperationException
On Windows, the kill switch's block could not be set as the disconnect leaves it.
- Win32Exception
On Windows, the kill switch's block could not be set as the disconnect leaves it.
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
ExtendByRewardedAd(CancellationToken)
Shows a rewarded ad, which extends the connected session.
Task ExtendByRewardedAd(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that completes once the ad's reward is settled.
Remarks
An ad that fails comes as the app's ad exceptions: without the app's window, its ShowAdNoUiException; then its
LoadAdException, its ShowAdException, or its AdBlockerException where the device's private DNS
may block ads. A failure of the VPN service comes as its own.
Exceptions
- InvalidOperationException
The app shows no rewarded ads, the VPN is not connected, the session cannot be extended now, or an ad is showing already.
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
GetAutomaticUpdate(CancellationToken)
Gets whether the app's automatic update is on.
Task<bool> GetAutomaticUpdate(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
Exceptions
- InvalidOperationException
The system's tool could not be run.
- NotSupportedException
The app has no updater, or its updater has no switch of its own, as only a desktop's has.
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
GetInfo(CancellationToken)
Gets the app's information: its descriptor, features, settings, VPN profiles, state and languages.
Task<AppInfo> GetInfo(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
Exceptions
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
GetInstalledApps(CancellationToken)
Gets the apps installed on the device, for the split tunneling by app.
Task<IReadOnlyList<DeviceAppInfo>> GetInstalledApps(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task<IReadOnlyList<DeviceAppInfo>>
A task whose result is the apps.
Exceptions
- InvalidOperationException
Android could not list the apps.
- NotSupportedException
The device cannot list its apps, as iOS, Linux, and Windows outside a debug build.
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
GetRemoteAccess(CancellationToken)
Gets the remote access's state, as the pairing screen polls it.
Task<RemoteAccessState> GetRemoteAccess(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task<RemoteAccessState>
A task whose result is the state.
Remarks
Where the remote access is on, it binds again where the device's addresses changed; it starts nothing that is off.
Exceptions
- ObjectDisposedException
The web host was disposed.
- InvalidOperationException
The web host has no web content, or nothing could bind, as with no LAN address.
- UnauthorizedAccessException
The call came over HTTP from another device: the remote access is controlled from the device itself.
- NotSupportedException
The app was given no web host.
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
GetSplitDomains(CancellationToken)
Gets the domains the split tunneling includes or excludes.
Task<SplitDomains> GetSplitDomains(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task<SplitDomains>
A task whose result is the domains.
Exceptions
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
GetSplitIpsViaApp(CancellationToken)
Gets the IP ranges the app's own split tunneling includes or excludes.
Task<SplitIpsViaApp> GetSplitIpsViaApp(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task<SplitIpsViaApp>
A task whose result is the ranges.
Exceptions
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
GetSplitIpsViaDevice(CancellationToken)
Gets the IP ranges the device's VPN adapter includes or excludes.
Task<SplitIpsViaDevice> GetSplitIpsViaDevice(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task<SplitIpsViaDevice>
A task whose result is the ranges.
Exceptions
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
GetState(CancellationToken)
Gets the app's state as it stands, which the UI reads to refresh.
Task<AppState> GetState(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
Exceptions
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
GetSupportedSplitCountries(CancellationToken)
Gets the countries the split tunneling by country can take, by their codes.
Task<IReadOnlyList<string>> GetSupportedSplitCountries(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task<IReadOnlyList<string>>
A task whose result is the countries' codes.
Exceptions
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
InternalAdDismiss(ShowAdResult, CancellationToken)
Tells the app how the UI's own ad ended.
Task InternalAdDismiss(ShowAdResult result, CancellationToken cancellationToken)
Parameters
resultShowAdResultHow the ad ended.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
InternalAdError(string, CancellationToken)
Tells the app that the UI's own ad failed.
Task InternalAdError(string errorMessage, CancellationToken cancellationToken)
Parameters
errorMessagestringWhy it failed.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
Log(CancellationToken)
Gets the app's log.
Task<string> Log(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
Exceptions
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
PromotionImage(CancellationToken)
Gets the promotion image the app has saved.
Task<byte[]> PromotionImage(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
Exceptions
- NotExistsException
The app has no promotion image.
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
SetAutomaticUpdate(bool, CancellationToken)
Turns the app's automatic update on or off.
Task SetAutomaticUpdate(bool value, CancellationToken cancellationToken)
Parameters
valuebooltrue to turn it on.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- InvalidOperationException
The system's tool could not be run, or it refused the change.
- NotSupportedException
The app has no updater, or its updater has no switch of its own, as only a desktop's has.
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
SetSplitDomains(SplitDomains, CancellationToken)
Sets the domains the split tunneling includes or excludes, and saves them.
Task SetSplitDomains(SplitDomains value, CancellationToken cancellationToken)
Parameters
valueSplitDomainsThe domains.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
SetSplitIpsViaApp(SplitIpsViaApp, CancellationToken)
Sets the IP ranges the app's own split tunneling includes or excludes, and saves them.
Task SetSplitIpsViaApp(SplitIpsViaApp value, CancellationToken cancellationToken)
Parameters
valueSplitIpsViaAppThe ranges.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that represents the asynchronous operation.
Remarks
The lists are written one at a time, so a list that fails leaves those before it saved.
Exceptions
- InvalidOperationException
A range's two ends are of different families, or reversed.
- FormatException
A line is not an address, a range or a network.
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
SetSplitIpsViaDevice(SplitIpsViaDevice, CancellationToken)
Sets the IP ranges the device's VPN adapter includes or excludes, and saves them.
Task SetSplitIpsViaDevice(SplitIpsViaDevice value, CancellationToken cancellationToken)
Parameters
valueSplitIpsViaDeviceThe ranges.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that represents the asynchronous operation.
Remarks
The lists are written one at a time, so a list that fails leaves those before it saved.
Exceptions
- InvalidOperationException
A range's two ends are of different families, or reversed.
- FormatException
A line is not an address, a range or a network.
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
SetUserReview(AppUserReview, CancellationToken)
Records the person's rating of the app.
Task SetUserReview(AppUserReview userReview, CancellationToken cancellationToken)
Parameters
userReviewAppUserReviewThe rating, with the person's text.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
SetUserSettings(UserSettings, CancellationToken)
Sets the person's settings, and saves them.
Task SetUserSettings(UserSettings userSettings, CancellationToken cancellationToken)
Parameters
userSettingsUserSettingsThe settings.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that represents the asynchronous operation.
Remarks
A change the connected VPN can take applies at once; one it cannot raises the state's request to reconnect.
Exceptions
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
ShowAdPrivacyOptions(CancellationToken)
Shows the ad network's privacy options, for the person to change their consent.
Task ShowAdPrivacyOptions(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that represents the asynchronous operation.
Remarks
It needs the app's window, and fails without it, as the app's UiContextNotAvailableException; a form that
fails comes as the app's AdException.
Exceptions
- InvalidOperationException
The app has no consent provider.
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
StartRemoteAccess(CancellationToken)
Starts the remote access, for a phone to pair, and keeps the screen on meanwhile where the device's screen sleeps.
Task<RemoteAccessState> StartRemoteAccess(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task<RemoteAccessState>
A task whose result is the state afterwards.
Exceptions
- ObjectDisposedException
The web host was disposed.
- InvalidOperationException
The web host has no web content, or nothing could bind, as with no LAN address.
- UnauthorizedAccessException
The call came over HTTP from another device: the remote access is controlled from the device itself.
- NotSupportedException
The app was given no web host.
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
StartUpdate(CancellationToken)
Starts the update, as the person's Update.
Task StartUpdate(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- InvalidOperationException
No newer release is known, or its package is not on https.
- NotSupportedException
The app has no updater, or its updater has a screen of its own, a store's, or cannot update this copy, as an APK a store installed or a package not on https.
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
StopRemoteAccess(CancellationToken)
Stops the remote access, and lets the screen sleep again.
Task StopRemoteAccess(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- UnauthorizedAccessException
The call came over HTTP from another device: the remote access is controlled from the device itself.
- NotSupportedException
The app was given no web host.
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
VersionCheck(CancellationToken)
Checks for a newer version now, as the person asked.
Task<VersionCheckResult> VersionCheck(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task<VersionCheckResult>
A task whose result is what the check found.
Remarks
A store with no window to show, or whose update screen fails to open, gives Failed; a store's check that fails otherwise falls back to the feed.
Exceptions
- InvalidOperationException
The app's own updater could not check, as where a system tool would not start.
- NotSupportedException
The app has no updater.
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.
VersionCheckPostpone(CancellationToken)
Puts the update's notice off for a while, as the person's Later.
Task VersionCheckPostpone(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- NotSupportedException
The app has no updater.
- ApiException
Over HTTP, the app failed with an exception of a type the transport does not rebuild, which ExceptionTypeName names, or answered with an error it does not name.
- OperationCanceledException
cancellationTokenwas canceled: over HTTP always, in process where the call honours it.