Is it possible to get the SIM number in firemonkey (Delphi)?

0

Is it possible to get the phone number (SIM number) in delphi firemonkey? I am looking in forums for a few hours and I do not find any example the library that allows to get the number of the cell

    
asked by anonymous 21.08.2018 / 20:44

1 answer

0

If it's android:

uses
  Androidapi.JNI.Telephony;

var
  tMgr: JTelephonyManager;
  PhoneNumber: String;
begin
  tMgr := TJTelephonyManager.Wrap((SharedActivityContext.getSystemService(TJContext.JavaClass.TELEPHONY_SERVICE) 
as ILocalObject).GetObjectID);
  PhoneNumber := JStringToString(tMgr.getLine1Number);
end;
    
21.08.2018 / 21:58