iOS Integration
Step 1: Create SDK File
Create LootlyCasherSDK.swift in your project:
LOOTLYCASHERSDK.SWIFT
import UIKit
import SafariServices
class LootlyCasher {
static let shared = LootlyCasher()
private let baseURL = "https://lootlycasher.online"
private var apiKey: String = ""
private var userId: String = ""
private var deviceId: String = ""
private var sandbox: Bool = false
private init() {}
func initialize(apiKey: String, userId: String, deviceId: String = "", sandbox: Bool = false) {
self.apiKey = apiKey
self.userId = userId
self.deviceId = deviceId
self.sandbox = sandbox
print("LootlyCasher initialized for user: \(userId)")
}
func showOfferwall(from viewController: UIViewController) {
let sandboxParam = sandbox ? "&sandbox=1" : ""
let urlString = "\(baseURL)/api/offerwall/\(apiKey)?user_id=\(userId)&device_id=\(deviceId)\(sandboxParam)"
guard let url = URL(string: urlString) else { return }
let safari = SFSafariViewController(url: url)
viewController.present(safari, animated: true)
}
}
OBJECTIVE-C
// Use Swift bridging header or call from Swift interop [[LootlyCasher shared] initializeWithApiKey:@"YOUR_API_KEY" userId:@"user_123"]; [[LootlyCasher shared] showOfferwallFrom:self];