Comments (15)
This library has very few features and I can answer some of your questions. I also hope to work with you to solve some problems with this library.
I've been using this library for about two weeks now, and some of the solutions need to be verified by you
另外你是**人吗?
from dart-sdk.
1:Get list of topic
var me = MySingleton.tinode.getMeTopic();
MySingleton.tinode.onRawMessage.listen((value) {
Get the list of topic here
}
var info = await me.subscribe(im.MetaGetBuilder(me).withLaterSub(null).withDesc(null).withTags().withCred().build(), null);
from dart-sdk.
2:Find other user
Same as the first question,only Need to change here
MySingleton.tinode.getFndTopic();
from dart-sdk.
The third problem, which is in the demo
from dart-sdk.
@c1s1x1 Thank for the info.
After investigate I find that.
1- Get list of topic can use
tinode.getMeTopic().onSubsUpdated.listen((value) {
for (var item in value) {
Topic topic = tinode.getTopic(item.topic ?? '');
}
})
4- Listen to the incoming message of topic. can use
tinode.subscribe(
topic.name ?? '',
MetaGetBuilder(me)
.withLaterSub(null)
.withDesc(null)
.withTags()
.withCred()
.build(),
SetParams());
topic.onData.listen((DataMessage? value) {
print("data: ${value?.content}");
});
5- Listen to the typing message. can use
topic.onInfo.listen((InfoMessage value) {
print('${value.topic} ${value.what}');
});
2 and 3 still have no idea how to do it.
from dart-sdk.
Sorry, I have a problem answering the first question, I should use onSubsUpdated listener.
2:Find other user
var me =tinode.getFndTopic();
tinode.onRawMessage.listen((value) {
Find other user
};
await me.subscribe(
MetaGetBuilder(me)
.withLaterSub(null)
.withDesc(null)
.withTags()
.withCred()
.build(), null);
By the way, what country are you from?
from dart-sdk.
The third question I did not understand
from dart-sdk.
I'm from Viet Nam.
- Get list message of topic: I mean load previous messages from the server. It should be pagination I think.
- Find other user: I don't understand how to find multiple times with different keywords if you only subscribe one time. There must be other way.
from dart-sdk.
- Get list message of topic: Well, I don't know how to load previous messages from the server.
- Find other user: I didn't find a way to search by different keywords.I also need this feature
from dart-sdk.
@c1s1x1 I strongly recommend you to read the Tinode server API document first, then use dart-sdk.
from dart-sdk.
@c1s1x1 I strongly recommend you to read the Tinode server API document first, then use dart-sdk.
老哥,我看过服务器端的文档,后台支持的功能,不代表flutter端就有对应的接口功能啊,肯定是在不改动源码的基础上使用最好。就好比tinodewWeb端支持文件图片传输,flutter端就不支持,必须改源码才可以。
如果你也看过flutter端,能回答一下怎么去创建新topic和添加成员吗?最近卡在这里了
from dart-sdk.
OK so basically we can send all kind of message same as js client,
message type is defined in package-types.dart
const String Hi = 'hi';
const String Acc = 'acc';
const String Login = 'login';
const String Sub = 'sub';
const String Leave = 'leave';
const String Pub = 'pub';
const String Get = 'get';
const String Set = 'set';
const String Del = 'del';
const String Note = 'note';
- To get of previous messages of topic:
tinode.getMeta(
topic.name ?? '',
MetaGetBuilder(topic)
.withData(
null,
topic.messages.isEmpty
? null
: topic.messages.first.seq,
20)
.build(),
);
- To find other user, which I copy from js:
var res = await tinode.getFndTopic().setMeta(SetParams(
desc: TopicDescription(
public: 'keyword',
)));
res = await tinode.getFndTopic().getMeta(
MetaGetBuilder(tinode.getFndTopic()).withSub(
null, null, null).build()
);
@cfanboy Could you post the link to the doc here?
from dart-sdk.
OK so basically we can send all kind of message same as js client,
message type is defined in package-types.dartconst String Hi = 'hi'; const String Acc = 'acc'; const String Login = 'login'; const String Sub = 'sub'; const String Leave = 'leave'; const String Pub = 'pub'; const String Get = 'get'; const String Set = 'set'; const String Del = 'del'; const String Note = 'note';
- To get of previous messages of topic:
tinode.getMeta( topic.name ?? '', MetaGetBuilder(topic) .withData( null, topic.messages.isEmpty ? null : topic.messages.first.seq, 20) .build(), );
- To find other user, which I copy from js:
var res = await tinode.getFndTopic().setMeta(SetParams( desc: TopicDescription( public: 'keyword', ))); res = await tinode.getFndTopic().getMeta( MetaGetBuilder(tinode.getFndTopic()).withSub( null, null, null).build() );
@cfanboy Could you post the link to the doc here?
https://github.com/tinode/chat/blob/master/docs/API.md here
from dart-sdk.
I'm from Viet Nam.
- Get list message of topic: I mean load previous messages from the server. It should be pagination I think.
- Find other user: I don't understand how to find multiple times with different keywords if you only subscribe one time. There must be other way.
now I can get historical data,but it seems that I have to change the source code
await grp!.subscribe(
MetaGetBuilder(grp!)
.withSub(null, null, null)
.withData(null,null,24)
.withDesc(this.topicSubscription.touched)
.build(), null);
It's changed here, but I'm not sure if the change will have any impact
First time to get historical data without any problem,but When I get the history message for the second time, I get an array out of bounds error
I think there is a bug here. so,I made a simple change to replace when the exact same message is matched
from dart-sdk.
@c1s1x1 这个库,你用的怎么样, 现在有人想找人基于tinode做一个简易的客服系统, 如果有兴趣可以Telegram联系: @miaomiao_c
from dart-sdk.
Related Issues (17)
- [Feature] Is there a specific update plan? HOT 1
- Call setMeta error HOT 6
- Tinode Connect and Disconnect Issue HOT 9
- How to send pictures or files ? HOT 1
- Can I create a new Topic and add new members to it? HOT 1
- Explain method _updateDeletedRanges()
- onPres can not will be triggered when a `pres` message is received
- is the sdk ready to use? HOT 4
- [Error] _Exception (Exception: topic not found (404)) HOT 2
- How to know who send message to me? HOT 2
- Q1) On login how to get the UserId? HOT 1
- How to get user/groups imageUrl on the All Chat part? HOT 1
- How to get chatId/GroupId dynamic?\ HOT 1
- While getting the chat of a specific group/user how to differenciate the Messages i.e sender or reciever? HOT 1
- Is there any date/time variable in the chat to place them in order? HOT 1
- How can set the message head data? HOT 2
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 dart-sdk.