Installation
Add the package for your platform, then do the app setup it needs. Every platform also needs a bot key and a market slug from the Kindly platform
Requirements
- iOS 15.4 or later
- Swift Package Manager. The SDK is a signed binary, KindlyWebView.xcframework, and there is no CocoaPods pod for native iOS apps
Add the package
In Xcode, choose File > Add Package Dependencies, enter https://github.com/kindly-ai/sdk-chat-webview and add the KindlyWebView product to your app target. In a Package.swift:
dependencies: [
.package(url: "https://github.com/kindly-ai/sdk-chat-webview.git", from: "1.0.0"),
],
targets: [
.target(name: "YourApp", dependencies: [
.product(name: "KindlyWebView", package: "sdk-chat-webview"),
]),
]A beta needs an exact pin, for example exact: "X.Y.Z-beta.N", because from: never resolves a prerelease
Set up the app
Add the usage descriptionsīģŋ to your app's Info.plist. No LSApplicationQueriesSchemes entries are needed
Usage descriptions on iOS
The chat lets people attach photos and videos and save images. iOS ends an app that reaches one of these features without its usage description, so add all four keys:
Key | Used for |
|---|---|
NSCameraUsageDescription | Taking a photo or video to attach |
NSMicrophoneUsageDescription | Recording a video with sound |
NSPhotoLibraryUsageDescription | Attaching from the photo library |
NSPhotoLibraryAddUsageDescription | Saving an image from the chat |
The SDK logs an error at start when the camera, microphone or photo library add description is missing
App-bound domains on iOS
If your app declares WKAppBoundDomains, list chat.kindlycdn.com in it. Without it WebKit blocks the chat's bridge, so the SDK reports itself unsupported and shows an unsupported screen instead of the chat
Android manifest and R8
An Android app adds nothing, whether it uses the SDK directly or through Flutter or React Native. The SDK's manifest merges into your app with:
- the INTERNET permission
- its chat activity, not exported
- a FileProvider with the authority ${applicationId}.kindly.webview.fileprovider, for photos taken in the chat
- a <queries> entry for android.media.action.IMAGE_CAPTURE, so the file picker can offer the camera
The consumer R8 rules ship inside the package and keep the SDK's classes, so a minified release build needs no rules of yours. The Android library is already minified
Next, Initializationīģŋ