> How do i do this myself now?
As the essay notes, it's through TelephonyManager on Android. On iOS it used to be possible through CoreTelephony private APIs, but I think Apple cracked down on these a few years back and either removed them entirely or locked them down behind entitlements, as they were getting abused by analytics frameworks.