Actual Activation: iOS Developer Guide

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.

Dependencies

  • BlinkReceipt SDK (Actual Capture)
  • Google-Mobile-Ads-SDK

Installation

Swift Package Manager (Recommended)

  1. In Xcode, go to File > Add Package Dependencies
  2. Enter: https://github.com/BlinkReceipt/blinkengage-ios
  3. 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
    }
}
Swift

Presenting 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:

ContextWhen It FiresYour Responsibility
"ScanFinished"Receipt summary screen loadsReturn an NSNumber with the base reward amount, or nil for no base reward
"Promo"Receipt items match a promotional offerInformational only. rewardAmount contains the earned amount. Return nil
"Boost"User completes a rewarded adInformational only. rewardAmount contains the earned amount. Return nil
"BarcodeCollection"User scans a product barcode in the correction flowInformational 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

PropertyTypeDescription
rewardCurrencyNameStringDisplay name for your in-app currency (e.g., “points”, “coins”, “stars”)
rewardCurrencyPerDollarDoubleConversion rate. 100.0 means 100 points = $1
rewardCurrencyIconUIImage?Icon displayed next to reward amounts. Set to nil to show the currency name instead

Appearance Customization

PropertyTypeDescription
offerWallHeaderBackgroundColorUIColorBackground color of the Offer Wall header
offerWallHeaderTextColorUIColorText color of the Offer Wall header
receiptSummaryHeaderBackgroundColorUIColorBackground color of the receipt summary header
receiptSummaryHeaderTextColorUIColorText 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
Swift

Disable 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

Resources

Let’s Turn Proof Into Action 

Your next move should be backed by proof, and we’re here to help you leverage real data for real results. Start turning verified insights into measurable impact today.