ICC Recapped SDK enables seamless integration of ICC's recapped experience into iOS applications, providing a customizable web-based interface with native callbacks and navigation controls.
- iOS 14.5+
- Swift 5.0+
- Xcode 13.0+
The ICC Recapped SDK is available through Swift Package Manager.
### 1.4.3
- Import the SDK:
import ICCWrapped
- Create a basic integration:
class ExampleViewController: UIViewController {
private var user: ICCWrapped.User?
override func viewDidLoad() {
super.viewDidLoad()
setupUser()
}
private func setupUser() {
user = ICCWrapped.User(
token: "your-auth-token",
name: "User Name",
email: "[email protected]"
)
}
func launchICCWrapped() {
guard let user = user else { return }
ICCWrapped.launch(
from: self,
user: user,
environment: .production,
stayInGameUri: "iccdev://stayinthegame",
completion: {
print("ICC Recapped launched successfully")
}
)
// Set up callbacks after launch
if let iccWebView = iccWrappedSDK.sharedWrappedView {
setupCallbacks(for: iccWebView)
}
}
}
The SDK supports two environments:
public enum Environment {
case development // Uses staging URL
case production // Uses production URL
}
Configure user details for authentication:
let user = ICCWrapped.User(
token: "your-auth-token", // Authentication token
name: "User Name", // User's name
email: "[email protected]" // User's email
)
Configure the URI for the "Stay in the Game" feature:
stayInGameUri: "iccdev://stayinthegame"
Images are handled natively through the iOS Share Sheet. When a user triggers an image share action, the SDK will present the standard iOS share sheet with available options for the user to share the image.
Image downloading is handled natively by the SDK. When a user selects to download an image, it will be saved directly to the device's photo library.
To enable image downloading functionality, you must add the following permissions to your app's Info.plist:
<key>NSPhotoLibraryAddUsageDescription</key>
<string>We need access to save images to your photo library when you download content from the ICC Recapped experience.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to your photo library to upload and share photos.</string>
This permission will prompt the user to allow your app to save images to their photo library the first time they attempt to download an image.
Register callback handlers to respond to user actions:
private func setupCallbacks(for iccWebView: ICCWebView) {
// Handle navigation to ICC
iccWebView.navigateToICCAction = { [weak self] viewController in
self?.handleNavigateToICC(from: viewController)
}
// Handle navigation to Stay in the Game
iccWebView.navigateToStayInTheGame = { [weak self] viewController in
self?.handleNavigateToStayInTheGame(from: viewController)
}
// Handle navigation to Handle Login
iccWebView.signInWithIccCompletion = { [weak self] success in
self?.handleSignInWithIcc(success: success)
}
// Handle closing the wrapped view
iccWebView.closeTheWrapped = { [weak self] success in
self?.handleCloseWrapped(success: success)
}
}
private func handleNavigateToICC(from viewController: UIViewController) {
viewController.dismiss(animated: true) {
// Add your ICC navigation logic here
}
}
private func handleSignInWithIcc(success: Bool) {
if success {
// Handle successful login
} else {
// Handle login failure
}
}
private func handleNavigateToStayInTheGame(from viewController: UIViewController) {
// Add your Stay in the Game navigation logic here
}
private func handleCloseWrapped(success: Bool) {
// Add your cleanup or post-close logic here
}