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

Add support for Android >= 33 #48

Open
tmtit opened this issue Jul 9, 2024 · 1 comment
Open

Add support for Android >= 33 #48

tmtit opened this issue Jul 9, 2024 · 1 comment

Comments

@tmtit
Copy link

tmtit commented Jul 9, 2024

I used your library to get the phone number, but it doesn't work with eSIM. I tried replacing
subscriptionInfo.getNumber();
with
final int id = SubscriptionManager.getActiveDataSubscriptionId(); final String phoneNumber = subscriptionManager.getPhoneNumber(id);
and it worked. This method was added in API 33 to replace the deprecated getNumber()

doc: https://developer.android.com/reference/kotlin/android/telephony/SubscriptionManager#getphonenumber_1

@amorenew
Copy link
Owner

amorenew commented Jul 9, 2024

@tmtit How could I test it on an emulator, I don’t have esim on my personal phone?

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

2 participants