π¨ "SEND_SMS" or Intent.ACTION_SENDTO Permission Not Allowed in App - Android OS 15
In Android 15 (API level 34) , the SEND_SMS permission is restricted for most apps. This change is part of Google's security enhancements to prevent misuse and protect user privacy. π Why You See This Error Restricted Permissions : Starting from Android 15, only default SMS apps or apps granted special carrier privileges can request the SEND_SMS permission. Non-Default Apps : If your app is not the system's default SMS app, it cannot send SMS using the SmsManager or Intent.ACTION_SENDTO . β
Solutions and Workarounds Here are a few options depending on your app's needs: 1. Check if Your App is the Default SMS App If your app is a messaging app, request users to set it as the default SMS app using this intent: Intent intent = new Intent (Telephony.Sms.Intents.ACTION_CHANGE_DEFAULT); intent.putExtra(Telephony.Sms.Intents.EXTRA_PACKAGE_NAME, getPackageName()); startActivity(intent); 2. Use SMS Verification API (For OTPs) If you're sending S...