bebnev / react-native-user-agent

Library that helps you to get mobile application user agent and web view user agent strings
MIT License
42 stars 42 forks source link

Device name is harder to parse than before #18

Closed lucasbfr closed 2 years ago

lucasbfr commented 4 years ago

Hi there,

I see there is a change in the way the device name is generated since iPhone 7: it used to be possible to locate it easily by using a regex looking for iPad|iPhone + "/" and stopping with a space : iPad/Pro_10.5-inch, iPhone/6s_Plus, ... However, the string now contains spaces (iPhone 11 Pro Max), which means that spaces are no longer a delimiter. The only semi-reliable way to split the string on the server's end is to stop at "iOS" and hope that systemName remains that way with future versions.

Would it be possible to return to the previous behaviour? (underscores instead of spaces)

Thanks!

pke commented 4 years ago

you can stop at the comma?

bebnev commented 2 years ago

version 2.3.1

pke commented 2 years ago

@bebnev are those the official Device names, Safari/Chrome will also use? I am asking since the iPhone SE 2nd Generation is also just the iPhone SE here. Also iPad 9th Generation doesn't seem to be supported? What about Apple Watch?