-
Notifications
You must be signed in to change notification settings - Fork 439
Meteor DDP connection #35
Comments
@rodrigok Can you explain how the basic connection works? Just to get started:
|
This one (https://github.com/boundsj/ObjectiveDDP) is actually more interesting, because it have authentication methods that follow Meteor pattern. |
Looks good, and quite a lot has been done, we just need look into library and maybe help improvement i saw that does not have to much commit last fill months, i already started looking into code, but i believe is a good start 👍 |
Yes I also had the one @rafaelks mentioned in mind... Haven't looked into either of them in much detail yet though.. Do you guys know why we should go with DDP and not use the REST APIs that Rocket.Chat provides? |
One great advantage from approach of using DDP its her use of websocket, while REST will lead to always create connection for request, we will actually open multiple channels some times for do our requests, and depend of how many messages user are sending and receiving, this could cause overhead, sure thinking at big scale. I really like REST, but for purpose of "chat", this interface i believe we need go with socket :) I don't know if helped, any other information will be helpful :) |
Hey, I'm the guy who did the REST API. And in my honest opinion - please don't use it ! 😁 Let me better qualify ... please don't use it for the Native iOS app. Meteor and DDP are what defines Rocket.Chat, otherwise we're just another kindamatter, slacky dak, let's yap, etc. We're talking about two orders of magnitude difference in terms of responsiveness, scalability, and efficiency. It is a royal pain to adapt existing UIKit views, especially for UITableView - but result will be worth it. Some bleeding edge attempts to adapt: |
awesome! thanks so much for sharing this info @felipeflorencio / @Sing-Li !! I guess we only need to decide on which ddp library to use then... Anyone have any thoughts to share on that? |
Thanks @felipeflorencio, @Sing-Li! :-) So, I was studying both libs yesterday and seems that https://github.com/boundsj/ObjectiveDDP is better to us. Or maybe we could create a new lib based on DDP specification (sounds too crazy?). |
@rafaelks I liked your crazy idea :) all existing libs of DDP for iOS sucks, creating a new one using swift 2 would be better and likely a good experience, but you will need to port EJSON and MiniMongo too. |
Sounds good, i already saw a little about this lib ObjectiveDDP and need some improvements, if we started create a new one with just what we want. Would be great start new one :) I tried create a issue to improvement for ObjectiveDDP for her OAuth connection that use NSURLConnection to improvement using NSURLSession but they said that if something that already work why change? So far i saw its not good we using a lib that don't want improvement her code. |
@felipeflorencio awesome! It will be a new, and better, lib for DDP. Meteor needs this. I tried to create one project with this existing libs with the help of @rafaelks and it was very difficult to implement even very simple things. Maybe with Switft 2 and some NoSQL database for iOS the work could be easier. @engelgabriel will talk to MDG to try to get some help :) |
Soon they say to start we begin :D would be great. But just one point, use Core Data would be better, with Core Data we could get better from a database like that Apple always do full support and improvement. I don't know deep about NoSQL for sure, actually i'm a mobile guy, but tried implement another kinds of database as i saw so far was not a good idea guys ;) |
@felipeflorencio how hard is to use Core Data for data with no defined schema? I listened a lot about https://realm.io/ |
Actually its really easy, and if want get more easier we could use some lib like MagicalRecord, you could see here : https://github.com/magicalpanda/MagicalRecord. Look how easy is create entity. For all these i really like more Realm.io, its a product that they want get improvements and its good. But for a open-source project i believe its not a good way for us |
wow -- isn't this a little out of scope for this project to build our own DDP impl?? having said that, I've not tried using either of the 2 proposed libs, so I don't know how easy that would be.. will take a look as soon as possible... |
It may not be in this case. We don't need everything offered by DDP, and @rodrigok knows intimately what we need and the optimal format or way to get at it. |
Honestly, I have no idea how much time it would take to us. But, the idea of writing a new Meteor client for iOS sounds interesting, mainly because currently implementations are written in Obj-C or in Swift but don't have mostly of methods that we need (1 & 2). Of course we could get some of the current projects and contribute to, but since we're starting a complete new project in Swift 2, why not write a new DDP protocol wrapper in Swift 2 too? It actually could a complete separated project from this one, to be used by every other app that wants to use Meteor. [1] - https://github.com/boundsj/ObjectiveDDP/blob/master/ObjectiveDDP/MeteorClient.m#L357-L371 |
Hi guys, |
I have not. IMHO if no one is working on that, we should start using an existent solution and then in a future, move to a made-in-home solution. |
@rafaelks ok - sounds like a plan! ( i'm afraid I won't have a chance to look into the ddp speciifcs myself till next week though... : / ) |
Hello there, I have started using objectiveDDP and I got an issue. There is a method called loginWithSessionToken that I use in order to resume the user's session when the app starts. I keep the session token from the previous login with nsuserdefaults and I try to login with that session cookie but I get an error: I don't know if this is a problem with Rocket.chat or with the objectiveDDP. Could someone please check this? I also submitted an issue to objectiveDDP repo.... |
I found the problem.... boundsj/ObjectiveDDP#159 (comment) |
I am working with the objectiveDDP for a while now and I 've managed to do a couple things. I can login, logout, get the meteor collections and some other stuff BUT I can't create a collection from the client like the web app does and according to objectiveDDP this is not possible. I think this is going to be a problem because the server streams the messages through the ChatMessage collection, that the client creates, so no collection no messages... |
Hi @kormic The objectiveDDP does just the DDP part of it includes the Mini-Mongo functionality? Creating a client side only collection has nothing to do with DDP itself, it is Mini-Mongo's job. |
@engelgabriel You have to excuse me because I am not a meteor.js expert and I m still digging into the code to understand a few things. Right now the way I am getting the messages is by subscribing to "messages" + roomId. I found this in the /server/publications/messages.coffee. I am still trying to figure out how the client gets the messages. I talked with some guys and they told me that this publication is not used any more so I guess this is not the way I should do it. So while this is working for now, i don't know if it's the "right" thing to do. I would appreciate if someone could give me directions about how the client subscribes to each room's messages. P.S.> I am watching some tutorials these days and I m starting to have a better understanding about meteor (it's awesome btw 😄 ). I see that you are using this package arunoda:streams so I guess this has to do something it. I must check more on this. I also have to check if I can implement this from the client side....Check this |
Hi @kormic , you are right. We are using the arunoda:streams to send the messages. We avoided using pure subscriptions for server performance issues. But arunoda:streams are in fact built on top of regular subscriptions. Did you try reading/following the DDP messages on the browser app inspecting the websocket messages on the network tab of the development tools in chrome? Let me get @rodrigok and @rafaelks involved and discuss if you could use objectiveDDP to subscribe to a stream. Did you try Guys? |
@engelgabriel ok, I had a look at the websocket messages and I see that they are coming in from the stream-messages collection. I also talked a little bit with @Sing-Li (thanks man!) who told me he was having the same problem with hubot. He told me how he did it so I will give it a try. I will let you know! |
The native app must connect with Meteor server via DDP protocol.
Here's a nice lib for iOS to make DDP connection: https://github.com/martijnwalraven/meteor-ios.
The text was updated successfully, but these errors were encountered: