one
one copied to clipboard
fix(android): use `expo-platform` over `user-agent`
For some reason on Android user-agent doesn't contain React or Expo keyword.
@natew could you verify if that works in your setup? my is still breaking because of some strange react-native-screens imports problem (even after applying patch).
Breaking on android? I think we patch just one of the files, does android have a specific platform file? That's one thing we need to get better support of in general.
Hm, yea - after applying patch properly, Rollup doesn't give the error. But esbuild only resolves the first extension it found, so in our case it cause another problem - when we're fetching bundle for Android and we have:
resolveExtensions: [
'.ios.js',
'.android.js',
]
it will pick Platform.ios.js and in react-native.js we'll have OS: "ios" which is the reason why it doesn't work. I guess we need to pass proper extension based on ?platform query param