Comments (12)
Hey @hongsa ,
Can you share a bit more code on how you have initialized client and created the channel? That will help us with debugging.
from stream-chat-react-native.
const channelId = `${targetClazz.id}-${teacher.id}-${parent.id}`;
const conversation = await chatClient.channel('messaging', channelId, {
name: `${teacher.name} / ${parent.name}`,
image: targetClazz.profile_image,
members: [userInfo.id, receiver.id],
clazz: {
name: targetClazz.name,
profile_image: targetClazz.profile_image,
},
});`
await conversation.watch();
Only watch channel.
Anything I have to do??
from stream-chat-react-native.
Hey @hongsa ,
I tried testing the app/sdk on our side with given version of RN and stream-chat-react-native, and it seems to be working fine. It's quite hard to say whats going wrong here
But we have some debug/logging capabilities on JS client.
When you initialize the client, please pass the logger function as part of options object (3rd parameter):
e.g.,
const chatClient = new StreamChat('qk4nn7rpcn75', null, {
logger: (type, msg) => {
console.log(msg);
}
});
This shall log all the activities in js client. Please check this for more details about logger
function. - https://github.com/GetStream/stream-chat-js/blob/master/src/client.js#L106
You can enable remote debugger and fetch the logs in console of browser. If you can paste those logs here, that would be great. That will help us to check if something is failing for your case.
Note Make sure to send a message on channel to get the logs of those events as well.
from stream-chat-react-native.
"stream-chat-react-native": "^0.1.17",
"react": "16.8.3",
"react-native": "0.59.10"
And also remove netinfo because of this library.
Channel list's realtime works well.
But chatting is still not working.
When i was out and re inside to the room, it refresh. But it is not real time.
Please help me.
from stream-chat-react-native.
Thanks. Ok so from the logs I can see that, you are receiving the message.new
event. So there is no issue with watching the channel.
Is it possible for you to paste entire piece of code (related to stream ... you can leave api_key and secret keys blank) here or send us via email?
from stream-chat-react-native.
Hey @hongsa ,
Did you remove the code?
from stream-chat-react-native.
I sent you by email!
from stream-chat-react-native.
Re send
import React, { Component } from 'react';
import { View, SafeAreaView } from 'react-native';
import PropTypes from 'prop-types';
import {
Chat,
Channel,
MessageList,
MessageInput,
} from 'stream-chat-react-native';
import { Navigation } from 'react-native-navigation';
import { chatClient } from '~/utills/stream';
import { popScreen } from '~/utills/router';
const theme = {
colors: {
primary: '#00c896',
},
};
class ChatConversationContainer extends Component {
constructor(props) {
super(props);
Navigation.events().bindComponent(this);
}
componentDidMount() {
Navigation.mergeOptions(this.props.componentId, {
topBar: {
leftButtons: [{
id: 'close',
icon: require('~/assets/navigation/ic_arrow_back.png'),
}],
},
});
}
async navigationButtonPressed({ buttonId }) {
if (buttonId === 'close') {
const { navigatorProps: { isCreate = false, chatListComponentId }, componentId } = this.props;
if (isCreate) {
Navigation.popTo(chatListComponentId);
}
popScreen({ componentId });
}
}
render() {
const { navigatorProps: { channel } } = this.props;
return (
<SafeAreaView>
<Chat
style={theme}
client={chatClient}
>
<Channel
client={chatClient}
channel={channel}
>
<View style={{ display: 'flex', height: '100%' }}>
<MessageList />
<MessageInput />
</View>
</Channel>
</Chat>
</SafeAreaView>
);
}
}
ChatConversationContainer.propTypes = {
componentId: PropTypes.string.isRequired,
navigatorProps: PropTypes.shape({
channel: PropTypes.object.isRequired,
isCreate: PropTypes.bool,
chatListComponentId: PropTypes.object,
}).isRequired,
};
export default ChatConversationContainer;
from stream-chat-react-native.
I solve this problem...
In chat screen, I need to get channel again by query!!!
Why example is give to params??
This is not working in real time.
Please update your example
from stream-chat-react-native.
Hey @hongsa
You shouldn't need to query the channel again actually. I have a suspicion that something is going wrong when you pass the channel via param to Channel screen. In our examples we use react-navigation
(which still works). But in your case, you are using react-native-navigation
.
I tried to do the setup for react-native-navigation
library in our app example, just to test it out. But I am having some issues
I will update you once I manage to set it up and test your use case !! But great to hear that you have found a workaround for now :)
from stream-chat-react-native.
@hongsa So I managed to setup the example with react-native-navigation
and reproduced the issue about real time. As it turns out, when props are passed as parameters, they get totally modified. All the immutables properties and ws connections are disturbed. So yeah ... for now you will have to query the channels when u open channel screen. This is not the case for react-navigation
though.
from stream-chat-react-native.
Closing this issue for now. Solution would be to just pass channel id via params and then query the channel corresponding to channel id on channel screen.
from stream-chat-react-native.
Related Issues (20)
- [🐛] Url handler not working. HOT 13
- [🐛] Maximum update depth exceeded error happening when attaching images, Android Only HOT 5
- Is there any documentation for jest testing? HOT 2
- [🐛] UploadProgressIndicatorProps should extend PropsWithChildren HOT 1
- [🐛] App Crashes on iOS when uploading photo/attachment while offline HOT 10
- [🐛] Image compression is not consistently applied HOT 8
- [🐛] Encoded URL not working HOT 7
- [🐛] Photo without content is sent up through file picker HOT 1
- [🐛] reactions does not reflect all reactions, only latest reactions HOT 3
- Add an option to view all reactions (and their details) HOT 2
- Compress Images sent through file picker HOT 1
- 🔥 [🐛] Bug Report Title - Crash at onlyEmoji regex HOT 3
- [🐛] Unable to style overlay messageActions title HOT 1
- [🐛] Bug Report Title - Navigation in production is not working on iOS 🔥🔥 HOT 2
- [🐛] Bug Report Title - MessageContent not rendering newlines
- [🐛] TypeError: Cannot read property 'skin_variations' of undefined on AutoCompleteSuggestionList HOT 1
- groupStyles mislabels messages whose create time is sufficiently after the previous message and that follow "single" messages. Labelled "Bottom" when should be "top" or "single".
- Disable individual auto complete input HOT 1
- [🐛] Offline Mode Unread Count Out of Sync HOT 4
- [🐛] Unable to resolve PermissionsAndroid
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stream-chat-react-native.