From 30fa38b957b8781c7f5d68a315e957f4aeba8eaf Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 9 Oct 2026 17:18:12 +0000 Subject: [PATCH] Document 0.3.1 applyCode Result breaking change Call out that Android applyCode now uses Result, with a before/after migration snippet, and keep the upgrade target at 0.3.1. Co-authored-by: Kenny Ye --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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`).