pbakondy / cordova-plugin-sim

:cherries: A cordova plugin to get the device's SIM data (carrier name, mcc mnc, country code, telephonenumber, etc)
MIT License
163 stars 101 forks source link

TM.Error when retrieving SIM info from a deactivated Android 6.x #62

Open rolinger opened 7 years ago

rolinger commented 7 years ago

Expected behaviour

simSerialNumber, countryCode and phoneNumber should return nothing.

Actual behaviour

The above values return TM.Error which throws an error in the Chrome Inspector Console when the SIM plugin attempts to retrieve those non-existent values (because the phone is no longer on a carrier network (it previously was on T-Moble)). Makes me wonder if this would also happen on an Android Tablet (assuming the tablet was not on a carrier network).

I'm seeing this behaviour on

I am using

Hardware models

Samsung Galaxy S5

OS versions

Android 6+

I've checked these

So how can we reproduce this?

I deactivated my Samsung Galaxy S5 and now use it to primarily run test code. The SIM plugin returns TM.Error when trying to retrieve the above values from a device that is no longer on a carrier network.

Provide the steps to reproduce the issue.

Provide files, sources if available.