Getting Started with React Native
PubNub's React framework allows you to use PubNub's JavaScript SDK features within a React Native application.
Requirements
To use the PubNub React framework, you need:
- React 16.8 or above
- PubNub Javascript SDK.
- React Native development environment set up using the guides in React Native documentation (React Native CLI Quickstart tab)
PubNub account
Sign in or create an account to create an app on the Admin Portal and get the keys to use in your application.
When you create a new app, the first set of keys is generated automatically, but a single app can have as many keysets as you like. We recommend that you create separate keysets for production and test environments.
Download the React Native wrapper
-
Clone parent repository and enter the
examples/reactnative
directory.git clone https://github.com/pubnub/react
cd react/examples/reactnative -
Install dependencies:
npm install
-
Run the emulator:
# for Android:
npm run android
# for iOS:
npm run ios