Table of Contents

Interface IIntentsApi

Namespace
VpnHood.AppLib.Api
Assembly
VpnHood.AppLib.Api.dll

Represents the app's API for what the UI asks of the device: its permissions, its settings pages, the store's review and the share sheet.

public interface IIntentsApi

Remarks

Each needs the app's window open: without one, a call fails with the app's UiContextNotAvailableException. A failure comes as IAppApi describes, in process and over HTTP.

Methods

OpenAlwaysOnSettings(CancellationToken)

Opens the system's VPN settings, where the person turns always-on VPN on for the app.

Task OpenAlwaysOnSettings(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task

A task that represents the asynchronous operation.

Exceptions

NotSupportedException

The device cannot do 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

cancellationToken was canceled: over HTTP always, in process where the call honours it.

OpenAppNotificationSettings(CancellationToken)

Opens the app's notification settings in the system's settings.

Task OpenAppNotificationSettings(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task

A task that represents the asynchronous operation.

Exceptions

NotSupportedException

The device cannot do 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

cancellationToken was canceled: over HTTP always, in process where the call honours it.

OpenAppSettings(CancellationToken)

Opens the app's own page in the system's settings.

Task OpenAppSettings(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task

A task that represents the asynchronous operation.

Exceptions

NotSupportedException

The device cannot do 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

cancellationToken was canceled: over HTTP always, in process where the call honours it.

OpenKillSwitchSettings(CancellationToken)

Opens the system's VPN settings, where the person turns the system's kill switch on for the app.

Task OpenKillSwitchSettings(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task

A task that represents the asynchronous operation.

Exceptions

NotSupportedException

The device cannot do 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

cancellationToken was canceled: over HTTP always, in process where the call honours it.

OpenSettings(CancellationToken)

Opens the system's settings.

Task OpenSettings(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task

A task that represents the asynchronous operation.

Exceptions

NotSupportedException

The device cannot do 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

cancellationToken was canceled: over HTTP always, in process where the call honours it.

RequestNotification(CancellationToken)

Asks the person to let the app show notifications.

Task<bool> RequestNotification(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<bool>

A task whose result is true where the app may show them now.

Exceptions

NotSupportedException

The device cannot do 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

cancellationToken was canceled: over HTTP always, in process where the call honours it.

RequestQuickLaunch(CancellationToken)

Asks the system to add the app's Quick Launch, which the person accepts or refuses.

Task<bool> RequestQuickLaunch(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<bool>

A task whose result is true where the Quick Launch is added, or was already.

Exceptions

NotSupportedException

The device cannot do it.

RequestQuickLaunchException

The system answered no at once.

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

cancellationToken was canceled: over HTTP always, in process where the call honours it.

RequestUserReview(CancellationToken)

Asks the person for a review of the app, as the store shows it.

Task RequestUserReview(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task

A task that represents the asynchronous operation.

Exceptions

InvalidOperationException

The store's review could not be asked for.

NotSupportedException

The app has no store review.

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

cancellationToken was canceled: over HTTP always, in process where the call honours it.

ShareLog(CancellationToken)

Hands the app's log, as report.txt, to an app the person picks in the device's share sheet.

Task ShareLog(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task

A task that represents the asynchronous operation.

Exceptions

InvalidOperationException

On iOS, there is no window to show the share sheet from.

NotSupportedException

The device has no share sheet, as a TV.

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

cancellationToken was canceled: over HTTP always, in process where the call honours it.