React Native Detect Device is Android or iOS

Опубликовано: 09 Декабрь 2018
на канале: Skptricks
349
1

React Native Detect Device is Android or iOS

Post Link : https://www.skptricks.com/2018/12/rea...

NOTE : This is a demo after the post tutorial, to get complete information about this post/demo please do visit this blog (www.skptricks.com)

This tutorial explains how to detect device is android or ios in react native application. When building a cross-platform app, you'll want to re-use as much code as possible. React Native is a cross platform native application programming language comes with platform specific code. There are two types of .JS files in react native application program, first one is index.android.js and second is index.ios.js file. The index.android.js file is used to write code which should run specifically in the Android device and the index.ios.js file’s code should run into iOS devices.

Sometimes we need to use platform specific components in android and ios application, in order to use platform specific components in mobile device first we need to identify whether device is android or ios.