Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
chat-engine-react-native
Advanced tools
Reusable react native components for quickly creating a mobile app with chat functionality using Chat Engine.
To get started with chat-engine-react-native
create-react-native-app <name>
npm install --save chat-engine-react-native
Get a chatroom up in running in just a few lines of code
import React from "react";
import { StyleSheet, Text, View, Platform, StatusBar } from "react-native";
import ChatEngineCore from "chat-engine";
import typingIndicator from "chat-engine-typing-indicator";
import {MessageEntry} from "chat-engine-react-native";
import {MessageList} from "chat-engine-react-native";
const ChatEngine = ChatEngineCore.create({
publishKey: "<Insert PubNub publish key here>",
subscribeKey: "<Insert PubNub subscribe key here>"
});
const now = new Date().getTime();
const username = ['user', now].join('-');
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = {
chat: null,
renderChat: false,
me: null,
};
}
componentDidMount() {
//chatengine throws some warning about timing that is a part of the library itself
console.disableYellowBox = true;
ChatEngine.connect(username, {
signedOnTime: now
}, 'auth-key');
ChatEngine.on("$.ready", data => {
const me = data.me;
let chat = new ChatEngine.Chat('MyChat');
chat.plugin(typingIndicator({ timeout: 5000 })); //set this if you want your message entry to have a typing indicator
this.setState({chat: chat, renderChat: true, me: data.me});
});
}
render() {
return (
<View style={styles.container}>
{!this.state.renderChat ? (
<Text> Loading </Text>
) : (
<View style={{flex:1}}>
{Platform.OS === 'ios' && <StatusBar barStyle="default" />}
{Platform.OS === 'android' && <View style={styles.statusBarUnderlay} />}
<MessageList chat={this.state.chat} me={this.state.me}/>
<MessageEntry chat={this.state.chat} typingIndicator />
</View>
)}
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
},
statusBarUnderlay: {
height: 24,
backgroundColor: 'rgba(0,0,0,0.2)',
},
});
<MessageList chat={someChatObject} me={meUserObject} />
<MessageEntry chat={someChatObject} /> // optional prop of TypingIndicator to show typing indicator
<UserList chat={someChatObject} />
<ChatList chatList={chatList} />
Every component requires passing in a chat prop so the react native component knows what to interact with.
FAQs
Reusable react native components for quickly creating a mobile app with chat functionality using Chat Engine.
The npm package chat-engine-react-native receives a total of 0 weekly downloads. As such, chat-engine-react-native popularity was classified as not popular.
We found that chat-engine-react-native demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.