PlexySDK DOCS
React Native

Troubleshooting

Error codes, architecture notes, and version compatibility for the React Native SDK

Troubleshooting

Error handling

onError(error, component) receives every terminal failure, including the shopper closing the sheet. Branch on error.errorCode and always dismiss the UI:

import { ErrorCode } from '@plexy/react-native';

const onError = useCallback((error, component) => {
  component.hide(false);

  switch (error.errorCode) {
    case ErrorCode.canceled:
      // Shopper closed the payment sheet — not a failure, no alert needed
      break;
    case ErrorCode.sessionError:
      // Session could not be created — check the session data from your backend
      break;
    default:
      showPaymentFailedMessage(error.message);
  }
}, []);

Error codes

CodeMeaning
canceledByShopperThe shopper cancelled the payment. Treat as a normal outcome.
notSupportedPayment method not supported on the current platform.
notSupportedActionThis component does not support action handling.
noClientKeyNo clientKey in the configuration.
noPaymentMissing or invalid amount / countryCode in the configuration.
invalidPaymentMethodsThe paymentMethods response could not be parsed or is empty.
invalidActionThe action object could not be parsed.
noPaymentMethodThe type passed to start() is not in the provided payment methods list.
sessionErrorThe session could not be created.

For declined payments (as opposed to SDK errors), see Refusal reasons and Result codes.

Common issues

The app crashes with a missing native module

The JavaScript package is installed but the native side is not linked:

  • Bare React Native: run cd ios && pod install, then rebuild the app (a Metro reload is not enough).
  • Expo: make sure the plugin is in app.json and re-run npx expo prebuild --clean.
  • The SDK does not work in Expo Go — use a development build.

Redirect payment methods never return to the app

The shopper completes 3D Secure or a bank redirect in the browser, but your app never resumes:

  • iOS: verify the RedirectComponent.applicationDidOpen handler is in AppDelegate.swift and runs before RCTLinkingManager. Verify your URL scheme is registered.
  • Android: verify the intent-filter on your checkout activity and the PlexyCheckout.handleIntent(intent) call in onNewIntent.
  • Check that returnUrl in your configuration (and in your /sessions or /payments request) matches the registered scheme exactly.

Android build fails with a theme error

The native payment UI requires a Material Components theme. Make sure your app theme extends Theme.MaterialComponents (see Android setup).

Callbacks fire multiple times or not at all

Wrap every callback passed to <PlexyCheckout> in useCallback. Inline functions cause listener re-registration on each render and can drop or duplicate events.

New Architecture

The React Native New Architecture is supported on React Native 0.76.0 and above only. On older versions either:

  • keep using the Old Architecture, or
  • disable bridgeless mode with load(bridgelessEnabled = false).

Older React Native versions

React Native 0.74+ works out of the box. Older versions need manual adjustments:

React Native 0.73

  • Set kotlin to at least 1.9.10 in node_modules/@react-native/gradle-plugin/gradle/libs.versions.toml.
  • Set apiVersion to at least 1.7 in node_modules/@react-native/gradle-plugin/build.gradle.kts.

React Native 0.72 and below

  • Use Java 17.
  • Update compileTarget to 34 in android/build.gradle.
  • Set classpath("com.android.tools.build:gradle:8.1.4") in android/build.gradle.
  • Enable buildConfig in android/app/build.gradle: android.buildFeatures.buildConfig = true.

Google's Play Store target API requirements make React Native 0.73 and below effectively deprecated for new submissions. Upgrade if you can.

Debug logging

Turn on verbose SDK logs while investigating an issue:

const configuration: Configuration = {
  // ...
  analytics: { verboseLogs: true },
};

Then check Xcode's console or adb logcat for the native-side output.

Still stuck?

On this page