iOS SDK
Learn how to use our iOS SDK. It allows you to capture certain device signals that will be reported back to Prelude.
This SDK is currently in closed beta testing phase. Please contact us to get a SDK key to be able to start using it.
This guide is a work in progress. If you have any questions, please reach out.
The iOS Swift SDK
The iOS Swift SDK is published in GitHub at https://github.com/prelude-so/apple-sdk .
Using the Swift SDK
The Swift SDK allows you to capture certain device signals that will be reported back to Prelude.
It is provided as a regular Swift package that you can import as a dependency directly into your iOS application.
Usage of the SDK is very simple, you just need to configure it with your SDK key (you can find it in your Prelude Dashboard) and call a single dispatch function:
Once you get the dispatch ID you can report it back to your own API to be forwarded in subsequent network calls.
There is no restriction on when to call this API, you just need to take this action before you need to report back the dispatch ID. It is advisable to make the request early on during the user onboarding process to have the dispatch id available when required.
CocoaPods integration
We currently do not offer CocoaPods integration for the SDK, but creating one is a relatively straight forward process. The steps to take are:
- Download the sourcecode from this repository, for example to a directory like
prelude-apple-sdk/sdk
. - Open the
Package.swift
file and copy the url for the Core sdk defined in the binary target (similar tohttps://prelude-public.s3.amazonaws.com/sdk/releases/apple/core/X.X.X/PreludeCore-X.X.X.xcframework.zip
). - Download the Core SDK from that url and unzip it to a subdirectory of the one above (for example
prelude-apple-sdk/sdk/core
). You should have a single subdirectoryPreludeCore.xcframework
underprelude-apple-sdk/core
- Remove the
Package.swift
file. - Create a new
podspec
file in the root of theprelude-apple-sdk
directory with the following content:
The final directory structure should look like this:
Import this .podspec
file into your project and run normally.
With these steps you should have a working version of the SDK in your project.