Giter Club home page Giter Club logo

Comments (15)

c1s1x1 avatar c1s1x1 commented on June 19, 2024

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.

c1s1x1 avatar c1s1x1 commented on June 19, 2024

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.

c1s1x1 avatar c1s1x1 commented on June 19, 2024

2:Find other user
Same as the first question,only Need to change here
MySingleton.tinode.getFndTopic();

from dart-sdk.

c1s1x1 avatar c1s1x1 commented on June 19, 2024

The third problem, which is in the demo

from dart-sdk.

XuanTung95 avatar XuanTung95 commented on June 19, 2024

@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.

c1s1x1 avatar c1s1x1 commented on June 19, 2024

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);

image
By the way, what country are you from?

from dart-sdk.

c1s1x1 avatar c1s1x1 commented on June 19, 2024

The third question I did not understand

from dart-sdk.

XuanTung95 avatar XuanTung95 commented on June 19, 2024

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.

c1s1x1 avatar c1s1x1 commented on June 19, 2024
  • 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.

cfanboy avatar cfanboy commented on June 19, 2024

@c1s1x1 I strongly recommend you to read the Tinode server API document first, then use dart-sdk.

from dart-sdk.

c1s1x1 avatar c1s1x1 commented on June 19, 2024

@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.

XuanTung95 avatar XuanTung95 commented on June 19, 2024

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.

c1s1x1 avatar c1s1x1 commented on June 19, 2024

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?

https://github.com/tinode/chat/blob/master/docs/API.md here

from dart-sdk.

c1s1x1 avatar c1s1x1 commented on June 19, 2024

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
image

image

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
image
image

I think there is a bug here. so,I made a simple change to replace when the exact same message is matched
image

from dart-sdk.

NetFly-VPN avatar NetFly-VPN commented on June 19, 2024

@c1s1x1 这个库,你用的怎么样, 现在有人想找人基于tinode做一个简易的客服系统, 如果有兴趣可以Telegram联系: @miaomiao_c

from dart-sdk.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.