VGSShow

public final class VGSShow

An object you use for revealing and displaying data in corresponding subscribed VGS Show SDK views.

Get Subscribed Views

Custom HTTP Headers

  • Set your custom HTTP headers.

    Declaration

    Swift

    public var customHeaders: [String : String]? { get set }

Initialzation

  • Initialzation

    Declaration

    Swift

    public init(id: String, environment: String, hostname: String? = nil, satellitePort: Int? = nil)

    Parameters

    id

    String object, your organization vault id.

    environment

    String object, your organization vault environment with data region.(e.g. “live”, “live-eu1”, “sanbox”).

    hostname

    String object. Custom Hostname, if not set, data will be sent to Vault Url. Default is nil.

    satellitePort

    Int? object, custom port for satellite configuration. Default is nil. IMPORTANT! Use only with .sandbox environment! Hostname should be specified for valid http://localhost (for simulator) or in local IP format http://192.168.X.X (for real device connected to the same local network as Mac).

  • Initialzation

    Declaration

    Swift

    public convenience init(id: String, environment: VGSEnvironment = .sandbox, dataRegion: String? = nil, hostname: String? = nil, satellitePort: Int? = nil)

    Parameters

    id

    String object, your organization vault id.

    environment

    VGSEnvironment object, your organization vault environment. By default .sandbox.

    dataRegion

    String object, id of data storage region (e.g. “eu-123”).

    hostname

    String object. Custom Hostname, if not set, data will be sent to Vault Url. Default is nil.

    satellitePort

    Int? object, custom port for satellite configuration. Default is nil. IMPORTANT! Use only with .sandbox environment! Hostname should be specified for valid http://localhost (for simulator) or in local IP format http://192.168.X.X (for real device connected to the same local network as Mac) .

Manage Views

API Request

  • Send request to reveal data on specific path. VGSShow instance will use all subsribed elements contentPaths to reveal data.

    • path: Inbound rout path for your organization vault.
    • method: HTTPMethod, default is .post.
    • payload: VGSJSONData? object, default is nil. Should be valid JSON.
    • requestOptions: VGSShowRequestOptions? object, additional request options, default is nil.
    • completion: VGSResponse completion block. The completion handler to call when the load request is complete.

    Note

    Errors can be returned in the NSURLErrorDomain and VGSShowSDKErrorDomain.

    Declaration

    Swift

    public func request(path: String, method: VGSHTTPMethod = .post, payload: VGSJSONData? = nil, requestOptions: VGSShowRequestOptions? = nil, completion block: @escaping (VGSShowRequestResult) -> Void)