Start SMS User Consent listener (Android only)
When an SMS arrives, Android shows a bottom sheet with the message preview. User taps once to grant access, and the app receives the full SMS content.
startSmsConsent() to begin listeningOptional input: StartSmsConsentInputOptional configuration
Promise resolving to SmsConsentOutput with the full SMS message
Basic usage
const modules = await Eitri.modules()
const smsUserConsentModule = modules.smsUserConsent
if (!smsUserConsentModule) {
console.error('SMS User Consent module is not available')
return
}
try {
const result = await smsUserConsentModule.startSmsConsent()
console.log('SMS received:', result.message)
// Parse the message to extract verification code if needed
} catch (error) {
console.error('User denied consent or error occurred:', error)
// Show fallback: manual entry
}
- Module:
smsUserConsent- Install eitri-android-sms-user-consent- No Fallback: This is a new module-only API
const modules = await Eitri.modules();
if (!modules?.smsUserConsent) {
// SMS User Consent module unavailable
return;
}
Generated using TypeDoc
SMS User Consent API for Android
Overview
Provides one-tap SMS verification without requiring specific message format. When an SMS arrives, the system shows a consent dialog. User taps once to approve, and the app receives the full message content.
Platform Support