Data Revealing
VGS Show
An object you use for revealing and displaying data in VGS Show UI Elements.
Declaration
class VGSShowCreating a VGS Show instance
Use the following initializers to create VGSShow instance:
/// Initialzation
///
/// - Parameters:
/// - id: `String` object, your organization vault id.
/// - environment: `String` object, your organization vault environment with data region.(e.g. "live", "live-eu1", "sanbox").
init(id: String, environment: String)
/// Initialzation
///
/// - 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").
init(id: String, environment: VGSEnvironment = .sandbox, dataRegion: String? = nil)• All VGSShow instances in the Application will be working independently and only with UI Elements that are subscribed by
VGSShowinstance. • All VGSShow instances can be configured differently.\
Multiple Data Regions
Please use the following configuration to set up a specific data region if needed.
Show revealed data
To show revealed data you should subscribe VGS Show SDK UI Elements to VGSShow instance and send a reveal request.
Subscribe UI Components
In order to show revealed data, you should subscribe VGS UI Elements with correct contentPath value:
Code example
Revealed data will be shown only if VGSShow response contains expected key, that is same as
contentPathdescribed in subscribed VGS UI Element.
Send reveal request
In order to change aliases to the real data, you need to send reveal request. The aliases data will be revealed when the response goes through VGS proxy. If the request is success, revealed data will be automatically displayed in subscribed VGS Show UI Elements. You also can send any additional data in the request payload.
Code example
Add a Custom Hostname
When integrated with VGS, by default, the traffic is passed via VGS proxy, which has tntxxxxx.sandbox.verygoodproxy.com format, where tntxxxxx is your Vault identifier. Show SDK allows you to set your own hostname and make requests to a non-VGS domain name or localhost on your local machine.
Before adding a new Hostname you should create a CNAME record for your existing domain in your DNS provider’s account that should point to <VAULT_ID>.<ENVIRONMENT>.verygoodproxy.com.
** Learn more about Custom Hostnames**.
Then, in your Application create a VGSShow instance with the Custom Hostname:
• When the hostname is not valid or not registered in VGS system, it will be ignored by SDK and all the traffic will be passed via VGS proxy directly. • Only https scheme is supported.\
Setting Custom API Headers
There is an option to setup custom headers in VGSShow requests.
Code example
Getting content from Nested JSON Structure
When you need to show revealed data from a specific json structure you can do it by adding . notation into VGSLabel.contentPath string. Each . in a contentPath represents a new level of nesting.
Code example
Last updated

