Telefonica / webview-bridge

Novum JavaScript Bridge
MIT License
26 stars 7 forks source link

New method to get TAC identifier #127

Closed jeslat closed 3 months ago

jeslat commented 3 months ago

Due to this spec from Vivo, we need to add a new method to get TAC identifier. This method will be available only in Android because we can't obtain this information in iOS.

As this information is available starting Android 10, we will return a null value if it's not available in that device.

The TAC identifier is the first 8 digits of the IMEI. We already have a method to get the IMEI but to obtain this value, we need carrier privileges permission which in many cases we don't have. To get the TAC we don't need any special permission because it only identifies the device model, not the device itself.

Get TAC identifier

getDeviceTac: () => Promise<{tac: string | null}>
Request → {type: "TAC", id: string} 
Response → {type: "TAC", id: string, payload: {tac?: "1234"}}
atabel commented 3 months ago

LGTM, but I'd rename it to getDeviceTac. I know we use request prefix for requestDeviceImei, but most of the bridge methods have the getXXX naming convention.

atabel commented 3 months ago

https://jira.tid.es/browse/WEB-1800