Android TelephonyManager subscriberid()

938 views Asked by At

I'm using android TelephonyManager to get the subcriber Id ( using getSubscriberId() method )

but based on the new android permission update they have mention below statement

getSubscriberId Added in API level 1

public String getSubscriberId ()

If the calling app's target SDK is API level 28 or lower and the app has the READ_PHONE_STATE permission then null is returned.

If the calling app's target SDK is API level 28 or lower and the app does not have the READ_PHONE_STATE permission, or if the calling app is targeting API level 29 or higher, then a SecurityException is thrown

But still I could get the subscriber Id using the getSubscriberId() in android api level 24 ( which is running on android emulator). It givess proper value for subscriber Id

Will it be a problem in other real devices ( api level <= 28). because my app will not work without subscriber Id

0

There are 0 answers