Solved

React-native SDK does not get Platform properties right

  • 20 October 2022
  • 2 replies
  • 172 views

Hi,

we are implementing Amplitude React-native SDK to track our mobile app (iOS/Android)

But event automatically record Platform as “Web”, not “Android” or “iOS”

Have you had such a problem? How to solve it without custom development 

icon

Best answer by jarren.patao 25 October 2022, 00:29

View original

2 replies

Userlevel 4

Hi @agesan,

Would you be able to confirm which SDK/Version you are using? Our legacy React-Native SDK was built on top of the mobile (iOS/Android) SDKs, whereas our new React Native SDK was built with TypeScript so this was primarily built with Browsers in mind. This is most likely why we are interpreting the Web platform here. For example, the when the SDK is run on web, the identity is stored in the browser cookie by default, whereas on native platforms identity is stored in async storage. (docs)

Hope this helps!

If you’re using the newest Typescript SDK, then all events during development will appear as ‘web’.  But once it goes into production, the events report properly.  See:

https://github.com/amplitude/Amplitude-TypeScript/issues/293

Reply