Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dual SIM cards, forward the SIM card slot number #18

Open
Opsmers opened this issue Feb 22, 2022 · 6 comments
Open

Dual SIM cards, forward the SIM card slot number #18

Opsmers opened this issue Feb 22, 2022 · 6 comments

Comments

@Opsmers
Copy link

Opsmers commented Feb 22, 2022

@optimalstrategy
Dear Sir,

In the case of Dual SIM cards, whether It can forward the data with the SIM card slot number or the remarks in SIM card slot management?

Thanks a lot!

@optimalstrategy
Copy link
Owner

Hi @Opsmers,

At the moment, there's no way to choose which messages are forwarded. I've had plans to implement some kind of filtering system for a year this point, but there's nothing ready to be released yet.

This feature request probably belongs to #4, but I'll keep the issue open in case if you'd like to be notified when the feature gets implemented.

@TheYarin
Copy link

@optimalstrategy I think @Opsmers just wanted the SIM card slot number to be mentioned in the message that's forwarded, not to forward only messages from a certain SIM card.

BTW @optimalstrategy, thank you so much for building this project! I tested it and it looks great! I'll use it in the future when I travel abroad, so I can continue receiving SMS messages. Thank you for sharing this with the world ❤

@TheYarin
Copy link

I looked into this and the underlying Telephony package does not expose this data, so this will be difficult.
This is the best info I found in this regard: https://stackoverflow.com/questions/35968766/how-to-figure-out-which-sim-received-sms-in-dual-sim-android-device

@optimalstrategy
Copy link
Owner

optimalstrategy commented Sep 24, 2022

@TheYarin Thanks for using my app and investigating the issue.

I don't think there's a way to get the sim index without switching to another library, re-implementing the SMS receival functionality from scratch, or PRing telephony to include the slot ID with the messages. The latter should be possible without breaking the API compatibility since telephony uses an SmsMessage newtype. However, its maintainer appears to be unresponsive at the moment, so I'll probably need to fork the project and depend on my fork's git URL.

I don't have a lot of time at the moment, but I'll see if I can hack something together in an hour or two.

EDIT: After further investigation, I think it might be possible to list the available sim cards using another library and compare their subscriptionId with the ID on each SMS message.

EDIT 2: Telephony doesn't extract subscriptionId when parsing messages, so forking it is required. I've tried patching the library to do that, but my phone and emulator don't provide a subscriptionId, likely because they're single sim, and I don't have a dual sim phone to test on.

@devoicy
Copy link

devoicy commented Mar 31, 2023

getDefaultSmsSubscriptionId 🤔

@bilogic
Copy link

bilogic commented May 31, 2023

this will be a GREAT to have!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants