tigase / Martin

(M) Martin - XMPP client library for Swift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

i cant register MucModule

ChenTeery opened this issue · comments

hi there:
I'm trying Tigase's Xmpp service for the first time, and I have to say it's amazing. It's more powerful and easy to use than Smack and Xmppframework.
but i have a problem, in your documentation , client register MucModule just need call init , like this:

 `client.modulesManager.register(MucModule())`

in TigaseSwift, XCode tell me i have to give a roomsManager:

 `client.modulesManager.register(MucModule(roomsManager:))`

and client's  connectionConfiguration have to setServerHost and setServerPort ,Otherwise, the link will fail.
Finally, I want to know which one means that the client has logged in successfully, whether the registration success or the verification success is successful.    
Can you answer me in as much detail as possible or update the document? Thank you very much``

and client's connectionConfiguration have to setServerHost and setServerPort ,Otherwise, the link will fail.

It will fail without that if your server doesn't have proper DNS SRV records for client-to-server connections (SRV records for _xmpp-client._tcp.).

Yes, you need to use following method to create instance of MucModule:

  • for master branch
    MucModule(roomManager: DefaultRoomManager(store: DefautRoomStore()));
  • for stable branch as a parameter for roomsManager parameter of init() method you need to pass instance of DefaultRoomsManager which requires implementation of a RoomStore but due we do not provide default implementation of this class in this version of the library.

Finally, I want to know which one means that the client has logged in successfully, whether the registration success or the verification success is successful.

For registration, I would suggest to use AccountRegistrationTask which accepts in the init() method a callbacks for handling SSL validation, and registration results.

For checking when client logged in in master branch you need to observe state property of XMPPClient. For stable branch you need to observe events which are documented at https://docs.tigase.net/tigase-swift/master-snapshot/Tigase_Swift_Guide/html/#_simple_client_sending_message

thank you very much , im in master branch ,but i cant find DefautRoomStore

i find it , Obviously, this is the Xcode problem,I have compared the stable and master branches. They are very different. Do you recommend the stable version

Stable version it the version which is used by stable versions of SiskinIM and BeagleIM. But new versions of those clients will use version of the library from the master branch. Moreover, stable branch is no longer being developed.

Our server uses tigase's very old redevelopment version. I want to know whether there will be incompatibility if I use master. Previously, I used smack open source framework in Android development, but I found that there seems to be incompatibility between tigase and the packages sent in smack. So now I consider replacing IOS and android with tigase open source libraries, I'm really in a dilemma now

@ChenTeery Xcode can't find DefautRoomStore - Can you let me know how did you solve it?

open class DefaultRoomStore: RoomStore {
is part of the library so it should be found without any issues by XCode

@hantu85 True, it is part of the library but I got an error saying "'DefaultRoomStore' initializer is inaccessible due to 'internal' protection level". I assume this happened because I used SPM to install Martin.

I think it may be related to usage of default initializer. We will look into that, but for now I would suggest to provide custom RoomStore and RoomManagerBase implementations

@hantu85 That is exactly what I did. I created custom RoomStore and RoomManagerBase implementations based on DefaultRoomStore and DefaultRoomManager. A special thanks for the default managers.