CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

RocketChatAdapter 0.1.5

RocketChatAdapter 0.1.5

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Mar 2016
SPMSupports SPM

Maintained by Jan Bartel.



 
Depends on:
VISPER-CommandBus~> 0.1.5
SwiftDDP>= 0
 

RocketChatAdapter

An adapter to connect your app to a Rocket-Chat server.

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

To include it in your own project take a look at the AdapterProtocol

public protocol RocketChatAdapterProtocol{

    /**
    * Connect to server
    **/
    func connect(endpoint:String,callback:(() -> ())?)

    /**
    * Register user
    **/
    func register(email: String,name: String,password: String,completion: ((userId: String?, error: ErrorType?) -> Void)?)

    /**
    * Get a suggestion for your username
    **/
    func usernameSuggestion(completion:((username: String?,error:ErrorType?)->Void)?)

    /**
    * Set username
    **/
    func setUsername(username:String,completion:((username: String?,error:ErrorType?)->Void)?)

    /**
    * Send forgot password email
    **/
    func sendForgotPasswordEmail(usernameOrMail: String, completion:((result: Int?,error: ErrorType?)->Void)?)

    /**
    * Logon
    **/
    func login(userNameOrEmail: String, password: String, completion:((result: AuthorizationResultProtocol?,error:ErrorType?)->Void)?)

    /**
    * Get all public channels
    **/
    func channelList(completion:((result: [ChannelProtocol]?,error: ErrorType?)->Void)?)

    /**
    * Get a channels id by its name
    */
    func getChannelId(name:String, completion:((roomId:String?, error: ErrorType?)->Void)?)

    /**
    * Join a channel
    **/
    func joinChannel(channelId: String,completion:((error:ErrorType?)->Void)?)

    /**
    * Leave a channel
    **/
    func leaveChannel(channelId: String,completion:((error:ErrorType?)->Void)?)

    /**
    * Get messages from channel
    **/
    func channelMessages(channelId : String, numberOfMessages:Int, start: NSDate?, end: NSDate?, completion: ((result: MessageHistoryResultProtocol?, error: ErrorType?)->Void)?)

    /**
    * Send a message
    **/
    func sendMessage(channelId : String,message: String, completion: ((result: Message?, error: ErrorType?) -> Void)?)

    /**
    * Set user status
    **/
    func setUserStatus(userStatus: UserStatus,completion: ((error:ErrorType?)->Void)?)

}

Requirements

Installation

RocketChatAdapter is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "RocketChatAdapter"

Author

Jan Bartel, [email protected]

License

RocketChatAdapter is available under the MIT license. See the LICENSE file for more info.