Migrating from v1.2.0 to v1.3.0
Overview
v1.3.0 adds a fourth parameter, blinkReceiptId, to rewardCallback. This lets you correlate a reward with the specific receipt that triggered it.
This is a source-breaking change — existing closures with three parameters will no longer compile. The fix is a one-line update.
Swift
v1.2.0
BlinkEngageSDK.shared.rewardCallback = { context, scanResults, rewardAmount in
// ...
return nil
}
v1.3.0
BlinkEngageSDK.shared.rewardCallback = { context, scanResults, rewardAmount, blinkReceiptId in
// blinkReceiptId lets you correlate the reward with a specific receipt.
return nil
}
If you don't need the receipt ID, ignore it with an underscore:
BlinkEngageSDK.shared.rewardCallback = { context, scanResults, rewardAmount, _ in
return nil
}
Objective-C
Add NSString * _Nullable blinkReceiptId as the fourth block argument. The first three parameters (context, scanResults, rewardAmount) are unchanged.
Parameter reference
| Parameter | Type | Description |
|---|---|---|
blinkReceiptId | String? (Swift) / NSString * _Nullable (ObjC) | Receipt identifier from BlinkReceipt, or nil when unavailable. Passed for contexts like "ScanFinished", "Promo", and "Boost". |
At a glance
| API | Change |
|---|---|
rewardCallback | New fourth parameter blinkReceiptId. |