diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c8b057..65b9199 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,28 @@ ## 0.3.1 +- **Breaking (Android only):** `applyCode` now returns `Result`, so 0.3.0 call sites won't compile until they're updated. This is deliberate. The 0.3.0 call couldn't report an error, so any app using it may show an invalid code as applied. Update each call to handle the failure case (snippet below). + + Before (0.3.0): + + ```kotlin + TapAppLink.applyCode(code) { json -> + // treated every callback as success, including error bodies + } + ``` + + After (0.3.1): + + ```kotlin + TapAppLink.applyCode(code) { result -> + result.onSuccess { json -> + // real success only + }.onFailure { error -> + // TapAppLinkRedeemException: UnknownCode, InactiveCode, WrongEnvironment, Network, Other + } + } + ``` + - **Fixed:** Android and React Native 0.3.0 could return an error from `applyCode()` as if it were a normal result, so an app could show a code as applied when it wasn't. Upgrade to 0.3.1, which raises a typed error for unknown, inactive and wrong-environment codes. iOS and Flutter 0.3.0 threw a generic error, and 0.3.1 makes it typed. - Send `X-TapAppLink-SDK-Version` on every request so the server can return distinct 410/400 statuses while remaining compatible with legacy 404 bodies. - `applyCode` callback is now `(Result) -> Unit` and failures are `TapAppLinkRedeemException` (`UnknownCode`, `InactiveCode`, `WrongEnvironment`, `Network`, `Other`).