docs: sync error codes with the latest SDK releases - #517
Merged
Conversation
Mark noPurchasesToRestore (1004) deprecated on the platforms that now bundle Android SDK 4.0.2, where restorePurchases() returns the current profile instead of failing: React Native 4.0.3 and Flutter 4.0.4. Unity and KMP still bundle earlier Android SDKs and iOS never returned 1004, so their tables are left as they are. Also correct the Flutter 1004 description, which attributed the error to the App Store. Only Google Play ever returned it. Android table fixes, all from the 4.0.0 release: - Drop INVALID_JSON, which no longer exists in the enum. Fallback file problems surface as WRONG_PARAMETER, so move that guidance there. - Add LOGGING_OUT_UNIDENTIFIED_USER. - Add a Flow rendering errors section for WRONG_ASSET_TYPE, JS_EXCEPTION, NAVIGATOR_NOT_FOUND, and INVALID_ACTION_URL, which reach the app through AdaptyFlowEventListener.onError rather than a method result. Drop the note that installing the React Native SDK also installs @adapty/core.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Audits every platform's error-code table against the enum at each SDK's latest release, and drops the
@adapty/corenote from the React Native installation docs.noPurchasesToRestore(1004)Android SDK 4.0.2 made
restorePurchases()return the current profile instead of failing when there is nothing to restore, and marked the enum constant deprecated. The cross-platform handler callsAdapty.restorePurchases, so the behavior propagates — but only once a platform bundles 4.0.2, which happens at a different release for each:The RN and Flutter tables now carry the deprecation note, and both restore-purchase articles get the same
:::infocallout Android already has.Flutter's 1004 row also had an older error: it blamed the App Store. Code 1004 has never existed in the iOS enum — it was only ever Google Play.
Android table
Three gaps, all opened by the 4.0.0 release:
INVALID_JSONremoved. Gone from the enum in 4.0.0, and it had no raise sites even in 3.17.2, so the row described an error the SDK never returned. Fallback-file problems actually surface asWRONG_PARAMETER, so that guidance moved there — matching what the RN doc already says.LOGGING_OUT_UNIDENTIFIED_USERadded.WRONG_ASSET_TYPE,JS_EXCEPTION,NAVIGATOR_NOT_FOUND, andINVALID_ACTION_URL. These reach the app throughAdaptyFlowEventListener.onErrorrather than a method result, which is why they sit apart from the main table. Descriptions come from the raise sites in the SDK.iOS, Unity, Flutter, and KMP tables otherwise match their enums exactly.
Follow-ups for the SDK team, not fixed here
paymentCancelled(2) is missing from the@adapty/corecode mapping, sogetErrorCode('paymentCancelled')returnsundefined— while native codes pass through unvalidated, soadaptyCode === 2can still occur on iOS. The RN doc documents the row and recommends comparing viagetErrorCode(). Left as is, since removing the row would hide an observable code.jsException(4105); Unity, KMP, React Native, and Capacitor have none. The other mappings need them before the docs can cover them.Checks
check-mdx-parseandlint-mdxclean.check-linksreports 0 broken internal links, and none in the touched files.