SDKs
iOS SDK
Integrate Flock’s referral and rewards platform into your iOS app with the official FlockSDK. This guide covers setup, configuration, and usage for Swift-based iOS apps.
Overview
FlockSDK-iOS enables seamless integration of Flock referral and rewards into your iOS applications. Effortlessly build powerful referral programs and track customer engagement in minutes.
- Identify and track users
- Present referral experiences as modals or full screen
- Handle events (close, success, invalid) in-app
- Officially supported by the Flock team
Requirements
- iOS 14.0 or later
- Swift 5.7 or later
- Xcode 14 or later
Installation
Swift Package Manager (Recommended)
- Open your Xcode project.
- Go to File > Add Packages…
- Enter the repository URL:
https://github.com/Flock-Solutions/FlockSDK-iOS.git
- Select a version and add the package to your target.
Usage
1. Configure the SDK
Call Flock.initialize
once, ideally in your AppDelegate
or early in your app’s startup:
2. Identify Your User
Identify the current user (after login or at app start):
3. Show a Flock Page
Present the referral page anywhere in your app:
Page Types
referrer
: Standard referral page for existing usersinvitee
: For invited usersinvitee?state=success
: Invitee success state
Event Callbacks
onClose
: Called when the page is closedonSuccess
: Called on successful referral code submissiononInvalid
: Called for invalid referral code submission
Support
- Open an issue on GitHub
- Email: support@withflock.com
License
FlockSDK-iOS is released under the MIT License.
Happy referring 🚀