Great question — answering as the UphillTech team:
You don't need to be the default SMS app to send — SEND_SMS runtime permission is enough. Default-app role is only required for receiving/aborting SMS or writing to the SMS provider. So a non-default app with SEND_SMS granted can send fine; GENERIC_FAILURE is almost always one of these: Wrong SmsManager subscription on a multi-SIM device. SmsManager.getDefault() is the usual culprit. On API 31+ use the system service and pin the subscription: SmsManager sms = context.getSystemService(SmsManager.class) .createForSubscriptionId(subId); // subId from SubscriptionManager.getActiveSubscriptionInfoList() // On older devices: SmsManager.getSmsManagerForSubscriptionId(subId). getDefault() is...
Full answer by Андрей Джабаров: https://stackoverflow.stackexchange.com/a/79954234 (CC BY-SA 4.0).
Need it done for your business? UphillTech.