Skip to content

lottverw/react-native-tutorial

This branch is 22 commits ahead of, 3 commits behind clbond/react-native-tutorial:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Max Presman
Feb 7, 2017
1cf5d5a · Feb 7, 2017

History

51 Commits
Oct 14, 2016
Sep 21, 2016
Oct 4, 2016
Oct 4, 2016
Sep 15, 2016
Oct 4, 2016
Oct 4, 2016
Oct 14, 2016
Sep 14, 2016
Sep 15, 2016
Sep 30, 2016
Sep 12, 2016
Oct 4, 2016
Dec 1, 2016
Oct 3, 2016
Oct 3, 2016
Feb 7, 2017

Repository files navigation

pubnub-chat-native

Real-time chat application using the PubNub network and React Native

Getting Started

Clone this repository.

Install the npm packages using:

$ npm install

Obtaining OAuth keys

  • Visit https://github.com/settings/profile
  • Select OAuth applications in the left panel
  • You will need separate keys for ios and android instances because the simulators use different IP addresses to refer to the host machine.

iOS

  • Go to Developer applications tab, then click on the Register new application button
  • Application name: Your app name
  • Homepage URL: http://localhost:3000
  • Authorization callback URL: http://localhost:3000/callback
  • Click on the Register application button
  • Get your Client ID and Client Secret

Android

  • Go to Developer applications tab, then click on the Register new application button
  • Application name: Your app name
  • Homepage URL: http://10.0.2.2:3000
  • Authorization callback URL: http://10.0.2.2:3000/callback
  • Click on the Register application button
  • Get your Client ID and Client Secret

Obtaining PubNub keys

  • Visit https://admin.pubnub.com/ to login or create an account
  • Click on the New app button and give it a name.
  • Click on the Create new keyset button and give it a name.
  • Get your Publish Key, Subscribe Key and Secret Key.
  • Make sure Access Manager and Stream Controller are on.

Configure authentication and PubNub keys

  • Edit the config.js file in the root folder and enter your configuration information for PubNub and GitHub.
  • Note that the default config.js includes some defaults that point to preconfigured GitHub applications, so you can use those values for testing purposes if you like.)

Run the application

Start the local server in a separate window.

For Android, make sure you have a virtual device running (to create and run virtual devices, use the command android avd), or a physical device connected through USB, then run this command:

$ npm run serve android &
$ react-native run-android

For iOS, to run the application, use:

$ npm run serve ios &
$ react-native run-ios

About

PubNub + React Native tutorial code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 83.9%
  • Objective-C 9.8%
  • Python 3.4%
  • Java 2.9%