Skip to content

vgs-samples/vgs-collect-show-ios-swiftUI-demo

Repository files navigation

SwiftUI sample with VGS Show/Collect iOS SDK

This examples shows how you can integrate VGS Collect/Show iOS SDKs into your SwiftUI application and secure sensitive data with us.

VGS Collect and Show iOS SDK are built upon UIKit, you can integrate VGS Collect and Show views using UIViewRepresentable wrappers into your SwiftUI code.
Check more official Apple tutorials how to adapt UIKit views for SwiftUI.

NOTE: This demo is just an example of how UIKit views from VGS Collect/Show SDKs can be integrated into your SwiftUI application. VGS doesn't have official SwiftUI support yet.

ios-collect-show-swiftui-sample-filled ios-collect-show-swiftui-sample-revealed

How to run it?

Requirements

Step 1

Go to your VGS organization and establish Inbound connection. For this demo you can import pre-built route configuration:

  • Find the configuration.yaml file inside the app repository and download it.
  • Go to the Routes section on the Dashboard page and select the Inbound tab.
  • Press Manage button at the right corner and select Import YAML file.
  • Choose configuration.yaml file that you just downloaded and tap on Save button to save the route.

Step 2

Clone demo application repository.

git clone git@github.com:vgs-samples/vgs-collect-show-ios-swiftUI-demo.git

Step 3

Setup "<VAULT_ID>".

Find DemoAppConfig.swift in app and replace vaultId constant with your vault id.

Step 4

Before running iOS project cd to the sample project directory and and run:

pod update

Use workspace file and run the demo.

NOTE: CardIO and CardScan support only iOS platform, scanners cannot be used in macOS app even it is built with SwiftUI.

Step 5

Submit and reveal the form then go to the Logs tab on a Dashboard find a request and secure a payload. Instruction for this step you can find here.