测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可证 | MIT |
发行最新发行版 | 2016年3月 |
SPM支持 SPM | ✗ |
由 Jan Bartel 维护。
依赖项 | |
VISPER-CommandBus | ~> 0.1.5 |
SwiftDDP | >= 0 |
一个将您的应用程序连接到 Rocket-Chat 服务器的适配器。
要运行示例项目,请克隆仓库,并首先从 Example 目录运行 pod install
。
要将其包含在自己的项目中,请查看 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)?) }
RocketChatAdapter 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile
pod "RocketChatAdapter"
Jan Bartel, [email protected]
RocketChatAdapter 在 MIT 许可下提供。有关更多信息,请参阅 LICENSE 文件。