Prerequisites
Before integrating Actual Activation, you must have the Actual Capture SDK (BlinkReceipt) installed and working. Activation extends the receipt scanning experience with rewards and monetization.
- Complete the BlinkReceipt iOS integration
- Obtain a license key with Activation features enabled (contact your account team)
Dependencies
- BlinkReceipt SDK (Actual Capture)
- Google-Mobile-Ads-SDK
Installation
Swift Package Manager (Recommended)
- In Xcode, go to File > Add Package Dependencies
- Enter:
https://github.com/BlinkReceipt/blinkengage-ios - Select the latest version and add the BlinkEngage product
CocoaPods
pod 'BlinkEngage', '~> 1.0.0'
Then run: pod install
SDK Initialization
Configure both the BlinkReceipt SDK and BlinkEngage SDK in your AppDelegate:
import BlinkEngage
import BlinkReceipt
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// 1. Configure BlinkReceipt SDK (required)
BRScanManager.shared().licenseKey = "YOUR-BLINKRECEIPT-LICENSE-KEY"
BRScanManager.shared().enableBlinkEngage = true
// 2. Configure user identification (at least one required)
BlinkEngageSDK.shared.user.emailHash = "hashed_email_string"
BlinkEngageSDK.shared.user.phoneHash = "hashed_phone_string"
BlinkEngageSDK.shared.user.clientUserId = "your_client_user_id" // optional, for extra mapping
// 3. Configure in-app currency
BlinkEngageSDK.shared.rewardCurrencyName = "points"
BlinkEngageSDK.shared.rewardCurrencyPerDollar = 100.0
BlinkEngageSDK.shared.rewardCurrencyIcon = UIImage(named: "coin_icon") // set to nil to show currency name instead
// 4. Customize appearance
BlinkEngageSDK.shared.appearance.offerWallHeaderBackgroundColor = .systemBlue
BlinkEngageSDK.shared.appearance.offerWallHeaderTextColor = .white
BlinkEngageSDK.shared.appearance.receiptSummaryHeaderBackgroundColor = .systemGreen
BlinkEngageSDK.shared.appearance.receiptSummaryHeaderTextColor = .white
// 5. Set up reward callback
BlinkEngageSDK.shared.rewardCallback = { context, scanResults, rewardAmount in
if context == "ScanFinished" {
// Return base reward value for scan completion.
// Use scanResults if the amount varies based on receipt data.
return NSNumber(value: 10.0)
} else if context == "Promo" {
// Promotional reward earned. No return value required.
print("User earned \(rewardAmount?.doubleValue ?? 0) points from promo")
} else if context == "Boost" {
// Boost reward earned from ad engagement. No return value required.
print("User earned \(rewardAmount?.doubleValue ?? 0) points from boost")
} else if context == "BarcodeCollection" {
// Barcode collection reward earned. No return value required.
print("User earned \(rewardAmount?.doubleValue ?? 0) points from barcode collection")
}
return nil
}
// 6. Debug mode (use test ad units during development)
BlinkEngageSDK.shared.debugModeEnabled = false
return true
}
}
SwiftPresenting the Offer Wall
The Offer Wall is the primary entry point for user engagement. Present it from any view controller:
class YourViewController: UIViewController {
func displayOfferWall() {
let offerWallViewController = OffersWallViewController()
offerWallViewController.delegate = self
present(offerWallViewController, animated: true)
}
}
extension YourViewController: OffersWallViewControllerDelegate {
func offerWallShouldDisplayHeaderView(_ viewController: OffersWallViewController) -> Bool {
return true // return false to hide the header
}
func offerWallHeaderTitle(_ viewController: OffersWallViewController) -> String? {
return "My Offers" // customize the Offer Wall title
}
func offerWallDidSelectFloatingAction(_ viewController: OffersWallViewController) {
// Handle the floating "Scan Receipt" action button tap
}
func offerWallShouldDisplayFloatingAction(_ viewController: OffersWallViewController) -> Bool {
return true // return false to hide the floating action button
}
}
Starting a Receipt Scan
Launch the receipt scanning flow using the standard BlinkReceipt camera:
class YourViewController: UIViewController {
func scanReceipt() {
let scanOptions = BRScanOptions()
BRScanManager.shared().startStaticCamera(
from: self,
cameraType: .standard,
scanOptions: scanOptions,
with: self
)
}
}
Once scanning completes, the Activation SDK handles the receipt summary screen, offer matching, reward calculations, and boost opportunities automatically.
Reward Callback Reference
The rewardCallback is called at different points in the user journey. The context parameter tells you what triggered the callback:
| Context | When It Fires | Your Responsibility |
|---|---|---|
"ScanFinished" | Receipt summary screen loads | Return an NSNumber with the base reward amount, or nil for no base reward |
"Promo" | Receipt items match a promotional offer | Informational only. rewardAmount contains the earned amount. Return nil |
"Boost" | User completes a rewarded ad | Informational only. rewardAmount contains the earned amount. Return nil |
"BarcodeCollection" | User scans a product barcode in the correction flow | Informational only. rewardAmount contains the earned amount. Return nil |
For "ScanFinished", the scanResults parameter contains the full receipt data, allowing you to set dynamic reward amounts based on merchant, total, user tier, or any other business logic.
Currency Configuration
| Property | Type | Description |
|---|---|---|
rewardCurrencyName | String | Display name for your in-app currency (e.g., “points”, “coins”, “stars”) |
rewardCurrencyPerDollar | Double | Conversion rate. 100.0 means 100 points = $1 |
rewardCurrencyIcon | UIImage? | Icon displayed next to reward amounts. Set to nil to show the currency name instead |
Appearance Customization
| Property | Type | Description |
|---|---|---|
offerWallHeaderBackgroundColor | UIColor | Background color of the Offer Wall header |
offerWallHeaderTextColor | UIColor | Text color of the Offer Wall header |
receiptSummaryHeaderBackgroundColor | UIColor | Background color of the receipt summary header |
receiptSummaryHeaderTextColor | UIColor | Text color of the receipt summary header |
Additional Offer Wall customizations are available through the OffersWallViewControllerDelegate methods.
Debug Mode
Enable debug mode during development to use test ad units:
BlinkEngageSDK.shared.debugModeEnabled = true
SwiftDisable before releasing to production.
Testing Checklist
- [BlinkReceipt SDK initialized with
enableBlinkEngage = true - At least one user identifier set (email hash or phone hash)
- Currency name and conversion rate configured
- Reward callback implemented and handling all context types
- Offer Wall presenting correctly
- Receipt scan completing and showing reward summary
- Boost ads displaying (use debug mode for test ads)
- Missed earnings correction flow accessible
- Debug mode disabled for production build