chat-examples-javascript

所属分类:hotest
开发工具:JavaScript
文件大小:0KB
下载次数:0
上传日期:2020-02-19 21:04:27
上 传 者sh-1993
说明:  PubNub聊天资源中心的示例代码和应用程序,
(Sample code and apps for PubNub’s Chat Resource Center,)

文件列表:
.eslintrc (201, 2020-02-19)
.travis.docs.js (7652, 2020-02-19)
.travis.yml (991, 2020-02-19)
CONTRIBUTING.md (4426, 2020-02-19)
LICENSE (1063, 2020-02-19)
babel.config.js (345, 2020-02-19)
examples/ (0, 2020-02-19)
examples/jest-config.json (383, 2020-02-19)
examples/react/ (0, 2020-02-19)
examples/react/package.json (845, 2020-02-19)
examples/react/public/ (0, 2020-02-19)
examples/react/public/favicon.ico (3870, 2020-02-19)
examples/react/public/index.html (1598, 2020-02-19)
examples/react/public/manifest.json (306, 2020-02-19)
examples/react/src/ (0, 2020-02-19)
examples/react/src/components/ (0, 2020-02-19)
examples/react/src/components/Header.js (1414, 2020-02-19)
examples/react/src/components/MessageList.js (1836, 2020-02-19)
examples/react/src/components/OnlineUsers.js (1265, 2020-02-19)
examples/react/src/components/SenderMessageList.js (1135, 2020-02-19)
examples/react/src/components/User.js (587, 2020-02-19)
examples/react/src/config/ (0, 2020-02-19)
examples/react/src/config/avatars.js (6008, 2020-02-19)
examples/react/src/config/chat.js (65, 2020-02-19)
examples/react/src/config/emojis.js (3066, 2020-02-19)
examples/react/src/config/keys.js (101, 2020-02-19)
examples/react/src/config/users.js (7407, 2020-02-19)
examples/react/src/containers/ (0, 2020-02-19)
examples/react/src/containers/AnimalForestChat.js (8779, 2020-02-19)
examples/react/src/containers/HistoryMessageList.js (1926, 2020-02-19)
examples/react/src/containers/MessageBody.js (2683, 2020-02-19)
examples/react/src/index.js (487, 2020-02-19)
examples/react/src/index.test.js (272, 2020-02-19)
examples/react/src/logo.svg (2671, 2020-02-19)
examples/react/src/serviceWorker.js (4951, 2020-02-19)
examples/react/src/styles/ (0, 2020-02-19)
examples/react/src/styles/avatars/ (0, 2020-02-19)
... ...

# PubNub JavaScript Chat [![Build Status](https://travis-ci.com/pubnub/chat-examples-javascript.svg?token=ey6rVJnpqsBKpxXy2fYF&branch=master)](https://travis-ci.com/pubnub/chat-examples-javascript) This repository contains sample code from the [Chat Resource Center](https://www.pubnub.com/developers/chat-resource-center/). ## Repository structure | Directory | Description | |:----------:| ----------- | | `examples` | Sample applications which show how to implement chat functionality using the PubNub SDK. | | `examples > react` | Source files for the Animal Forest Chat application. The complete tutorial can be found [here](https://www.pubnub.com/developers/chat-resource-center/docs/getting-started/react/).| | `snippets` | Verified and tested code snippets used in documentation.
Snippets from `chat-resource-center/` are used in the [Chat Resource Center](https://www.pubnub.com/developers/chat-resource-center/). | # Animal Forest Chat Application ## Requirements * [Node.js](https://nodejs.org/en/) * [Gulp](https://gulpjs.com) - required to install project dependencies. ## Prerequisites ### Sign Up for a PubNub Account If you don't already have an account, you can create one for free [here](https://dashboard.pubnub.com/). 1. Sign in to your PubNub [Admin Dashboard](https://dashboard.pubnub.com/), click Create New App, and give your app a name. 1. Select your new app, then click its keyset. Copy the Publish and Subscribe keys. You'll need these keys to include in this project. 1. Scroll down on the Key Options page and enable the [Presence](https://www.pubnub.com/products/presence/) and [Storage & Playback](https://www.pubnub.com/products/realtime-messaging/) add-on features. 1. Click Save Changes, and you're done! ### Using your PubNub keys Add your PubNub keys to the keys file in the config folder: ```bash cd examples/react/ vi src/config/keys.js ``` The file should look like the following: ```js module.exports = { publishKey: 'YOUR_PUBLISH_KEY', subscribeKey: 'YOUR_SUBSCRIBE_KEY' }; ``` ## Building the project 1. Navigate to the react project directory: ```bash cd examples/react/ npm install ``` 2. Run the app in development mode: ```bash $ npm start ``` Open [http://localhost:3000](http://localhost:3000) to view it in the browser. ## Further Information For more information about this project, or how to create your own chat app using PubNub, please check out the [React tutorial](https://www.pubnub.com/developers/chat-resource-center/docs/getting-started/react/) in the [Chat Resource Center](https://www.pubnub.com/developers/chat-resource-center/).

近期下载者

相关文件


收藏者