Migrating from v1.3.0 to v1.4.0
Overview
v1.4.0 introduces two breaking changes from v1.3.0:
- Explicit SDK bootstrap.
BlinkEngageSDK.sharedis no longer auto-initialized. You must callBlinkEngageSDK.start(debugMode:)exactly once — typically in your app delegate — before any use ofBlinkEngageSDK.shared. The publicdebugModeEnabledproperty has been removed; debug mode is chosen at bootstrap time. - Reward-currency configuration consolidation. The reward-currency properties on
BlinkEngageSDKand theAppearanceIconKey.offerRewardIcontheme key have been removed. All reward-currency settings now live on a singleBlinkEngageRewardConfiginstance assigned toBlinkEngageSDK.shared.rewardConfig.
Existing code that references the removed properties will no longer compile. Follow the steps below to migrate.
1. SDK bootstrap: call start(debugMode:)
In v1.3.0, the SDK initialized itself lazily and debug mode was toggled on BlinkEngageSDK.shared:
// v1.3.0
BlinkEngageSDK.shared.debugModeEnabled = true // removed in v1.4.0
In v1.4.0, the SDK is initialized explicitly and debug mode is set at start:
// v1.4.0 — call once at launch, before any use of BlinkEngageSDK.shared
#if DEBUG
BlinkEngageSDK.start(debugMode: true)
#else
BlinkEngageSDK.start(debugMode: false)
#endif
Calling BlinkEngageSDK.shared before BlinkEngageSDK.start(debugMode:) triggers a precondition failure. Calling start(debugMode:) more than once also triggers a precondition failure.
debugMode: true is for local development and integration testing only. It registers the device as a Google Mobile Ads test device so real ads can be served safely without affecting production metrics. Pass false for App Store submissions and customer-facing builds.
Objective-C
// v1.3.0
BlinkEngageSDK.shared.debugModeEnabled = YES; // removed
// v1.4.0
[BlinkEngageSDK startWithDebugMode:YES];
Property mapping
| Removed API (v1.3.0) | Replacement (v1.4.0) | Notes |
|---|---|---|
BlinkEngageSDK.shared.debugModeEnabled = Bool | BlinkEngageSDK.start(debugMode:) | Debug mode is fixed for the lifetime of the process. Call once; cannot be changed later. |
2. Reward-currency configuration
Matching v1.3.0 defaults
The simplest migration that reproduces the exact same styling v1.3.0 used out of the box:
BlinkEngageSDK.shared.rewardConfig = BlinkEngageRewardConfig(
currencyName: "pts",
rewardCallback: { context, amount, blinkReceiptId in
if context == "ScanFinished" { return NSNumber(value: 10) }
return nil
}
)
Two changes are needed: v1.4.0 renamed the default currency name from "pts" to "points", and rewardCallback is now a required parameter. Everything else — reward icon on list rows, toast copy, 100 units per dollar, 60% payout — already matches v1.3.0 defaults.
If you had customized values in v1.3.0, pass them to the config instead:
let config = BlinkEngageRewardConfig(
currencyName: "coins", // was: BlinkEngageSDK.shared.rewardCurrencyName = "coins"
currencyPerDollar: 500, // was: BlinkEngageSDK.shared.rewardCurrencyPerDollar = 500
userPayoutPercentage: 0.7, // was: BlinkEngageSDK.shared.userPayoutPercentage = 0.7
currencyImage: UIImage(named: "coin-icon"),
rewardCallback: { context, amount, blinkReceiptId in
if context == "ScanFinished" { return NSNumber(value: 10) }
return nil
}
)
BlinkEngageSDK.shared.rewardConfig = config
What changed from v1.3.0 defaults
| v1.3.0 default | v1.4.0 default | Action needed | |
|---|---|---|---|
| Currency name | "pts" | "points" | Pass currencyName: "pts" to keep the old label |
| List-row style | Reward icon + digits | Same (.currencyImage) | None |
| Toast / headline style | Amount + name in prose | Same (.currencyName) | None |
| Conversion rate | 100 | 100 | None |
| Payout percentage | 0.6 | 0.6 | None |
| Reward icon source | Theme (offerRewardIcon) | BlinkEngageRewardConfig.currencyImage (nil = built-in icon) | Move custom icon to currencyImage if you had one |
Property mapping
| Removed API (v1.3.0) | Replacement on BlinkEngageRewardConfig (v1.4.0) | Notes |
|---|---|---|
BlinkEngageSDK.rewardCurrencyName | currencyName | Default changed from "pts" to "points". Maximum 8 characters. |
BlinkEngageSDK.rewardCurrencyPerDollar | currencyPerDollar | Same semantics and default (100.0). |
BlinkEngageSDK.userPayoutPercentage | userPayoutPercentage | Same semantics and default (0.6). Valid range: 0.4 ... 1.0. |
BlinkEngageSDK.rewardCallback | BlinkEngageRewardConfig.rewardCallback | Signature changed — scanResults removed (see below). Required parameter with no default. |
AppearanceIconKey.offerRewardIcon | BlinkEngageRewardConfig.currencyImage + currencyImageLocations | Icon is now set on the config, not the theme. |
Callback signature change
The rewardCallback closure dropped the scanResults parameter:
| v1.3.0 signature | v1.4.0 signature | |
|---|---|---|
| Swift | (String, [String: Any]?, NSNumber?, String?) -> NSNumber? | (String, NSNumber?, String?) -> NSNumber? |
| Objective-C | NSNumber *(^)(NSString *, NSDictionary *, NSNumber *, NSString *) | NSNumber *(^)(NSString *, NSNumber *, NSString *) |
Remove the scanResults / NSDictionary parameter. rewardCallback is a required parameter — it has no default value.
Objective-C equivalent
BlinkEngageRewardConfig *config = [[BlinkEngageRewardConfig alloc]
initWithCurrencyName:@"coins"
currencyCode:nil
currencyCodePosition:RewardCurrencyCodePositionLeading
currencyPerDollar:500
userPayoutPercentage:0.7
currencyImage:nil
currencyImageLocations:BlinkEngageRewardConfig.imageLocationAll
rewardLabelStyle:RewardCurrencyLabelStyleCurrencyImage
messagingTextStyle:RewardCurrencyMessagingTextStyleCurrencyName
rewardRounding:RewardCurrencyRoundingWhole
rewardCallback:^NSNumber *(NSString *ctx, NSNumber *amt, NSString *blinkReceiptId) {
if ([ctx isEqualToString:@"ScanFinished"]) return @10;
return nil;
}];
BlinkEngageSDK.shared.rewardConfig = config;
3. Theme changes
| Removed API | Replacement | Migration step |
|---|---|---|
AppearanceIconKey.offerRewardIcon | BlinkEngageRewardConfig.currencyImage | Move the custom UIImage to the config's currencyImage parameter. Delete the case .offerRewardIcon: branch from your Theme.image(forKey:) implementation. |
Theme.isRewardIconEnabled | BlinkEngageRewardConfig.rewardCurrencyLabelStyle | Use .currencyImage to show the icon, or .currencyCode / .currencyName for text-only rows. |
Always match on enum case names (e.g. .offerWallFloatingButtonIcon), not raw integer values. Removing offerRewardIcon in v1.4.0 shifted the raw values of the remaining AppearanceIconKey cases.
At a glance
| API | Change |
|---|---|
BlinkEngageSDK.shared.debugModeEnabled | Removed — use BlinkEngageSDK.start(debugMode:) |
BlinkEngageSDK.rewardCurrencyName | Moved to BlinkEngageRewardConfig.currencyName |
BlinkEngageSDK.rewardCurrencyPerDollar | Moved to BlinkEngageRewardConfig.currencyPerDollar |
BlinkEngageSDK.userPayoutPercentage | Moved to BlinkEngageRewardConfig.userPayoutPercentage |
BlinkEngageSDK.rewardCallback | Moved to BlinkEngageRewardConfig.rewardCallback; scanResults param removed |
AppearanceIconKey.offerRewardIcon | Moved to BlinkEngageRewardConfig.currencyImage |
Theme.isRewardIconEnabled | Replaced by BlinkEngageRewardConfig.rewardCurrencyLabelStyle |