iOS Quick Start
If you want to start fast, follow these steps:
1. Gather Required Information
Before downloading and installing the SDK, please make sure you have the following information. Contact your Implementation Manager at ASAPP if you have any questions.
App ID | Also known as the “Company Marker”, assigned by ASAPP. |
---|---|
API Host Name | The fully-qualified domain name used by the SDK to communicate with ASAPP’s API. Provided by ASAPP and subject to change based on the stage of implementation. |
Region Code | The ISO 3166-1 alpha-2 code for the region of the implementation, provided by ASAPP. |
Supported Languages | Your app’s supported languages, in order of preference, as an array of language tag strings. Strings can be in the format “{ISO 639-1 Code}-{ISO 3166-1 Code}” or “{ISO 639-1 Code}”, such as “en-us” or “en”. Defaults to [“en”]. |
Client Secret | This can be an empty or random string* until otherwise notified by ASAPP. |
User Identifier | A username or similar value used to identify and authenticate the customer, provided by the Customer Company. |
Authentication Token | A password-equivalent value, which may or may not expire, used to authenticate the customer that is provided by the Customer Company. |
* In the future, the ASAPP-provided client secret will be a string that authorizes the integrated SDK to call the ASAPP API in production. ASAPP recommends fetching this string from a server and storing it securely using Secure Storage; however, as it is one of many layers of security, you can hard-code the client secret.
2. Download the SDK
Download the iOS SDK from the ASAPP iOS SDK releases page on GitHub.
3. Install the SDK
ASAPP provides the SDK as an .xcframework
with and without bitcode in dynamic and static flavors. If in doubt, ASAPP recommends that you use the dynamic .xcframework
with bitcode.
Add your chosen flavor of the framework to the “Frameworks, Libraries, and Embedded Content” section of your target’s “General” settings.
Include SDK Resources When Using the Static Framework
Add the provided ASAPPResources.bundle
to your target’s “Frameworks, Libraries, and Embedded Content” and then include it in your target’s “Copy Bundle Resources” build phase.
The SDK allows a customer to take and upload photos, unless these features are disabled through configuration. Since iOS 10, Apple requires descriptions for why your app uses the photo library and/or camera, which will be displayed to the customer. If you haven’t already, you’ll need to add these descriptions to your app’s Info.plist
.
- If you access
Info.plist
via Xcode’s plist editor, the description keys are “Privacy - Camera Usage Description” and “Privacy - Photo Library Usage Description”. - If you access
Info.plist
via a text editor, the keys are “NSPhotoLibraryUsageDescription” and “NSCameraUsageDescription”.
Validate iOS SDK Authenticity
ASAPP uses GPG (GNU Privacy Guard) for creating digital signatures. To install on macOS:
- Using Homebrew, install gpg:
brew install gpg
- Download the ASAPP SDK Team public key.
- Add the key to GPG:
gpg --import asapp_public.gpg
Optionally, you can also validate the public key. Please refer to the GPG documentation for more information.
Then, you can verify the signature using:
gpg --verify <-sdk-filename>.sig <sdk-filename>
ASAPP provides the signature alongside the SDK in each release.
4. Configure the SDK
Use the code below to create a config, initialize the SDK with the config, and set an anonymous user. Refer to the aforementioned Required Information for more details. ASAPP recommends that you initialize the SDK on launch in application(_:didFinishLaunchingWithOptions…)
. Please see the User Authentication section for details about how to authenticate an identified user.
5. Open Chat
Once the SDK has been initialized with a config and a user has been set, you can create a chat view controller that can then be pushed onto the navigation stack. ASAPP recommends doing so when a navigation bar button is tapped.
If you prefer to present the chat view controller as a modal, use the ForPresenting
method instead:
Once the chat interface is open, you should see an initial state similar to the one below:
Was this page helpful?