I'm working on a mobile app that deals with receiving SMS messages both retrieving from the SMS content URI "content://sms/inbox" or from a broadcast received, and I'm facing a challenging issue when it comes to differentiating SMS messages from dual SIM phones. The primary challenge is that I have very limited information to work with – I don't have access to phone numbers that are attached to the message, and all messages look the same. All I have access to is the sub_id and sometimes sim_slot.
Yes, I can use the sub_id to differentiate which messages where received from which sim card, even the android docs says this Best practices for unique identifiers
In this case, you need to associate app functionality with certain mobile service subscriptions on the device. For example, you may have a requirement to verify access to certain premium app features based on the device's mobile subscriptions via SIM.
Recommended identifier to use: Subscription ID API to identify SIMs that are used on the device. The Subscription ID provides an index value (starting at 1) for uniquely identifying installed SIMs (including physical and electronic) used on the device. Through this ID, your app can associate its functionality with various subscription information for a given SIM
But the issue is, sub_id can change, in scenarios like phone factory reset. And the docs continue to says that too
This value is stable for a given SIM unless the device is factory reset. However, there may be cases where the same SIM has a different Subscription ID on different devices or different SIMs have the same ID on different devices.
I'm wondering if there are any creative solutions or strategies that the community can suggest for automatically categorizing these messages based on the limited information I have (e.g., Subscription IDs, SIM slot indices), without relying on user intervention.
I'd appreciate any insights or alternative approaches that might help tackle this issue more effectively.
Thanks in advance for your assistance!