How it works...

Just for variety, I decided to try out platform detection in Snack (at https://snack.expo.io/; we mentioned this tool earlier in this chapter) because it would be much faster and simpler than running code on two actual devices.

I opened the page, and in the sample application that is provided, I just added the .fontFamily change I showed earlier, and tested the results for both platforms:

The Snack emulators show the different look of my app, with distinct fonts for Android (left) and iOS (right)

As we can see, issues with platform differences can be easily solved, and the end users of your app will get something that more closely match their expectations regarding colors, fonts, components, APIs, and whatnot.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset