@pitch-me/react-native-twilio-chat
Version:
A React Native wrapper for the Twilio Chat iOS and Android SDKs
24 lines (19 loc) • 526 B
JavaScript
import UserInfo from './UserInfo';
import {
NativeModules
} from 'react-native';
const {
TwilioChatClient
} = NativeModules;
class Member {
constructor(props) {
this.identity = props.identity
this.lastConsumedMessageIndex = props.lastConsumedMessageIndex;
this.lastConsumptionTimestamp = this.lastConsumptionTimestamp ? new Date(this.lastConsumptionTimestamp) : null;
}
getUser() {
return TwilioChatClient.getUser(this.identity)
.then(data => new UserInfo(data))
}
}
export default Member;