Integrate SuprSend SDK in your Swift project
SuprSendSdk
is deprecated. Please migrate to SuprSend
SDKThis documentation is for new version of iOS sdk. If you are using older version of sdk SuprSendSdk
please refer documentationSwift Package Manager (SPM)
https://github.com/suprsend/suprsend-swift-sdk
and keep the default version settings and click Add Package
button.In second dialog box, select your project’s target from dropdown and click Add Package
button.Cocoapods
pod "SuprSend"
and run pod install
to install the SDK.Create Client
AppDelegate.swift
and then initialize the SuprSend class inside application(_:didFinishLaunchingWithOptions:)
method.Params | Description |
---|---|
publicApiKey* | This is public Key used to authenticate API calls to SuprSend. Get it in SuprSend dashboard ApiKeys -> Public Keys section |
Authenticate User
Properties | Description |
---|---|
distinctId* | Unique identifier to identify a user across platform. |
userToken | Mandatory when enhanced security mode is on. This is ES256 JWT token generated in your server-side. Refer docs to create userToken. |
refreshUserToken | This function is called by SDK internally to get new userToken before existing token is expired. The returned string is used as the new userToken. |
async -> APIResponse
distinctId
is attached to SuprSend instance. To check for userToken also pass checkUserToken flag true.Reset user
async -> APIResponse