Overview
The otp_autofill package enables Android OTP autofill using the User Consent API and Retriever API, allowing apps to automatically detect and populate one-time passwords from SMS. It supports receiving OTP codes from alternative input sources, improving user experience during authentication. The package also works on iOS, providing cross-platform compatibility for PIN and OTP fields. Designed for seamless integration with form inputs, it reduces manual entry errors and speeds up login processes.
Use cases
- Automated OTP detection in login forms
- Enhancing user experience during two-factor authentication
- Supporting SMS-based verification flows
- Integrating with existing PIN or password input fields
- Enabling fallback OTP retrieval from alternate sources
Key features
- Uses Android's User Consent and Retriever APIs
- Cross-platform support (Android and iOS)
- Automatic OTP code extraction from SMS
- Fallback input method for OTP retrieval
- Simple integration with text fields
Suitable for
- Apps requiring secure OTP input
- Authentication flows with SMS verification
- Developers seeking reduced user friction
- Projects targeting Android and iOS platforms
- Form-heavy applications with PIN/OTP fields
Considerations
- Requires Android SDK 28+ for full functionality
- Limited to Android SMS autofill without additional setup
- iOS implementation relies on system-level OTP handling
- Permissions needed for SMS access on Android
- May require testing across different device manufacturers