Getting Started with iOS

Requirements

  • Swift 5.2
  • Xcode 11.0 or above
  • Xcode Deployment Target iOS 12.0 or above

Quick Start

An example project ProxyCheckInSample.workspace is included with Proxy Check-in SDK for iOS. This example demonstrates how to sense and identify authorized Proxy signals within your app.

Setup

1Step 1: Embed framework into your project

To start developing your own integration, embed the Proxy Check-in SDK Framework into your project. This is commonly done by dragging the framework into your Xcode project with your target selected.

  • Copy CheckInSDK.framework into your project file tree at a location of your choosing.
  • Select your main project in the project navigator.
  • Select your build target in the main editor, switch to the "General" tab of the main editor. Figure 1: Switch to project general settings
  • Click "+" and then choose "Add Other", select "Add Files". Figure 2: Click add in the Framework, Libraries, and Embedded content section
  • Find out and select the CheckInSDK.framework. Figure 3: Select Proxy Check-in framework

2Step 2: Configure iOS privacy permissions

The Proxy Check-in SDK uses Bluetooth to identify and check in guests via their Proxy signal, which requires certain privacy permissions. Additionally, the SDK uses the camera to scan a QRCode for setting credentials easily. Here we describe the required permissions you need to add to your Info.plist, and how we use each one.

NSBluetoothAlwaysUsageDescription (String)
Proxy Check-in requires this permission to identify and check in guests via their Proxy signal.

NSBluetoothPeripheralUsageDescription (String)
Proxy Check-in requires this permission to identify and check in guests via their Proxy signal.

NSCameraUsageDescription (String)
Proxy Check-in uses your camera to scan a QR code.

Figure 4: Privacy permissions

Using the SDK

notice-critical

Strongly recommend NOT to embed your AppKey and AppSecret in the project, follow the demonstration in the sample app or create your own authorizing flow.

Importing the SDK

1
import CheckInSDK

The Proxy Check-in SDK needs to be initialized only one time until the Uninitialize is called. The credentials passed in will be safely stored in iOS keychain and removed when uninitialized.

Initializing

  • Recommended - Only one step for presenting a preset provisioning flow inside the Proxy Check-in SDK.
1
2
3
4
ProxyCheckIn.presentProvisioningFlow(with: $viewController, // The viewController for presenting the provisioning flow.
  											                       // RootViewController of the top window will be chosen if nil.
                        			    environment: .unset,  // Set the environment of the application here, e.g., .stage, .production.
                                     onCompletion: ...)    // Completion handler that returns a cancelled or finished flag.

Figure 5: Sample app
Figure 6: Scanning QR code
Figure 7: Manually input credentials

  • You can also create your own setup flow for retrieving the credentials of your Proxy app, and then initialize the SDK at anytime manually.
1
2
3
ProxyCheckIn.initialize(appKey: "...",          // Set the key of the application here.
                        appSecret: "...",       // Set the secret key of the application here.
                        environment: .unset)    // Set the environment of the application here, e.g., .stage, .production.

Uninitializing

1
ProxyCheckIn.uninitialize()

Starting to observer Proxy Signals

1
ProxyCheckIn.start()

Stopping to observer Proxy Signals

1
ProxyCheckIn.stop()

Get all callbacks from the SDK

1
ProxyCheckIn.delegate = self

Get all organizations

1
2
3
ProxyCheckIn.getOrganizations { (organizations) in
  // Your implementations
}

Set an organization to verify the signals

1
2
3
ProxyCheckIn.setOrganization(withId: org.id) {
  // Your implementations
}

Get all hosts in the selected organization

1
2
3
ProxyCheckIn.getHosts { (hosts) in
  // Your implementations
}

The callback functions

1
2
3
func didDetect(new visitor: CheckInSDK.Visitor)
func didDetectCheckInIntent(of visitor: CheckInSDK.Visitor?, with result: CheckInSDK.ProxyCheckInResult)
func didUpdateNearby(visitors: [CheckInSDK.Visitor])