tufanv Expert Licensed User Longtime User Mar 8, 2017 #1 Hello, Is there any way to get the device's country like the b4a simcard library ? Thanks
Erel B4X founder Staff member Licensed User Longtime User Mar 8, 2017 #2 Yes: Code: Dim no As NativeObject no = no.Initialize("CTTelephonyNetworkInfo").RunMethod("new", Null).RunMethod("subscriberCellularProvider", Null) Dim iso As String = no.GetField("isoCountryCode").AsString Log(iso) It will return null if there is no sim card or the device is in airplane mode. Upvote 0
Yes: Code: Dim no As NativeObject no = no.Initialize("CTTelephonyNetworkInfo").RunMethod("new", Null).RunMethod("subscriberCellularProvider", Null) Dim iso As String = no.GetField("isoCountryCode").AsString Log(iso) It will return null if there is no sim card or the device is in airplane mode.