How-to · 4 min read

React Native: testing SMS OTP flows

Test phone-verification and SMS-autofill flows in a React Native app using disposable numbers and a programmatic code read.

Mobile SMS-autofill is hard to test on real devices in CI. With a programmatic number you can drive the flow from your test runner.

Pattern

  1. From your backend (or test harness), provision a number.
  2. Enter it in the app's phone field (Detox/Appium).
  3. Read the OTP from the API and type it — or assert autofill picked it up.
  4. Finish the order.
const order = await eveses.orders.create({ country: 'us', mode: 'activation', service: 'yourapp' });
await element(by.id('phone')).typeText(order.phone);
await element(by.id('send')).tap();
const code = await poll(() => eveses.orders.sms(order.order_id).then(o => o.sms?.[0]?.otp));
await element(by.id('otp')).typeText(code);
await eveses.orders.finish(order.order_id);

Keep the SDK call on the backend/test side, not in the app bundle, so the key never ships.


Ready to build? Create a free Eveses account, top up a wallet, and grab your API key — no KYC. See the API docs or live pricing.

FAQ

▸How do I test SMS OTP in React Native?
Provision a number from your backend/test harness, drive the app with Detox/Appium, and read the OTP from the API to submit it.
Related guides