Skip to content

docs: sync error codes with the latest SDK releases - #517

Merged
eandreeva-twr merged 1 commit into
mainfrom
docs/rn-error-codes-cleanup
Aug 18, 2026
Merged

docs: sync error codes with the latest SDK releases#517
eandreeva-twr merged 1 commit into
mainfrom
docs/rn-error-codes-cleanup

Conversation

@eandreeva-twr

Copy link
Copy Markdown
Collaborator

Audits every platform's error-code table against the enum at each SDK's latest release, and drops the @adapty/core note 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 calls Adapty.restorePurchases, so the behavior propagates — but only once a platform bundles 4.0.2, which happens at a different release for each:

Platform Bundled Android SDK Change
Android 4.0.2 already documented
React Native 4.0.3 4.0.2 updated
Flutter 4.0.4 4.0.2 updated
Capacitor 4.0.2-beta.1 4.0.2 affected, but its doc has no code table
Unity 3.17.2 unaffected; doc already omits 1004, matching the SDK
KMP 4.0.1 unaffected; doc doesn't list 1004
iOS never had 1004 in v3 or v4

The RN and Flutter tables now carry the deprecation note, and both restore-purchase articles get the same :::info callout 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_JSON removed. 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 as WRONG_PARAMETER, so that guidance moved there — matching what the RN doc already says.
  • LOGGING_OUT_UNIDENTIFIED_USER added.
  • New "Flow rendering errors" section for WRONG_ASSET_TYPE, JS_EXCEPTION, NAVIGATOR_NOT_FOUND, and INVALID_ACTION_URL. These reach the app through AdaptyFlowEventListener.onError rather 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/core code mapping, so getErrorCode('paymentCancelled') returns undefined — while native codes pass through unvalidated, so adaptyCode === 2 can still occur on iOS. The RN doc documents the row and recommends comparing via getErrorCode(). Left as is, since removing the row would hide an observable code.
  • The 4104/4106/4107 flow codes exist only on Android. Flutter has just jsException (4105); Unity, KMP, React Native, and Capacitor have none. The other mappings need them before the docs can cover them.

Checks

check-mdx-parse and lint-mdx clean. check-links reports 0 broken internal links, and none in the touched files.

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.
@eandreeva-twr
eandreeva-twr merged commit c177b1d into main Aug 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant