Releases: qiscus/QiscusCore-iOS
0.2.16
-Fix crash NSError can't cast to NSString
-Fix first time calling multiple in new room and got new message API
0.3.1
- Bug fix cannot room object after calling
getRoom(withChannel)
at the first-time call
0.2.15
- Bug fix cannot room object after calling getRoom(withChannel) at the first-time call
0.3.0
- Support Swift5
- Improvement user online/offline
Note:
We still support swift 4.2, you can take 0.2.x version
0.2.14
- improvement mqtt connection
- improvement database message
0.2.13
-Bugfix update room
-Prevent crash when error 404
0.2.12
-improvement comment receipt
-improvement profile in local db
0.2.11
We change the mechanism again for subscribe, we hope it's can help user to easy use.
Just set QiscusCoreRoomDelegate for subscribe room, and set nil for unsubscribe
for example :
var chatRoomDelegate : QiscusCoreRoomDelegate? = nil
// set delegate in viewDidLoad or viewWillappear
override func viewDidLoad() {
super.viewDidLoad()
chatRoomDelegate = self
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
chatRoomDelegate = nil
}
// MARK: Core Delegate
extension YourViewController : QiscusCoreRoomDelegate {
func didDelete(Comment comment: CommentModel) {
//
}
func onRoom(update room: RoomModel) {
//
}
func gotNewComment(comment: CommentModel) {
// 2check comment already in ui?
}
func didComment(comment: CommentModel, changeStatus status: CommentStatus) {
// check comment already exist in view
}
func onRoom(thisParticipant user: MemberModel, isTyping typing: Bool) {
//
}
func onChangeUser(_ user: MemberModel, onlineStatus status: Bool, whenTime time: Date) {
//
}
}
and we add method for subscribe Typing in outside room,
for example subscribe typing :
for room in rooms {
DispatchQueue.main.asyncAfter(deadline: .now()+1, execute: {
QiscusCore.shared.subscribeTyping(roomID: room.id) { (roomTyping) in
if let room = QiscusCore.database.room.find(id: roomTyping.roomID){
//update you tableView cell
}
}
})
}
for example unsubscribe typing :
QiscusCore.shared.unsubscribeTyping(roomID: roomID)
note :
*We remove public method subscribeRoom, and unSubscribeRoom, please change it like example
0.2.10
Changelog :
- fix avatarURL in message
- implement feature api getUsers
example :
QiscusCore.shared.getUsers(limit: 20, page: page, querySearch: nil, onSuccess: { (contacts, metaData) in
if (metaData.currentPage != self.page){
self.page += 1
}
}) { (error) in
}
0.2.9
Changelog:
- Fix api getRoom with channel
- Change mechanism Subscribe Room, after you load ChatRoom, please call method subscribe room
For Example :
var chatRoomDelegate : QiscusCoreRoomDelegate? = nil
// set delegate in viewDidLoad
override func viewDidLoad() {
super.viewDidLoad()
chatRoomDelegate = self
//getComment in room
// you can implementation this in viewDidLoad or viewWillAppear
QiscusCore.shared.getRoom(withID: _room.id, onSuccess: { [weak self] (room,comments) in
QiscusCore.shared.subscribeRooms(rooms: [room])
}) { [weak self] (error) in
//error
}
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
//if you want to remove subscribe, you can call this method
QiscusCore.shared.unsubscribeRooms(rooms: [room])
}
// MARK: Core Delegate
extension YourViewController : QiscusCoreRoomDelegate {
func didDelete(Comment comment: CommentModel) {
//
}
func onRoom(update room: RoomModel) {
//
}
func gotNewComment(comment: CommentModel) {
// 2check comment already in ui?
}
func didComment(comment: CommentModel, changeStatus status: CommentStatus) {
// check comment already exist in view
}
func onRoom(thisParticipant user: MemberModel, isTyping typing: Bool) {
//
}
func onChangeUser(_ user: MemberModel, onlineStatus status: Bool, whenTime time: Date) {
//
}
}
*if you don't call method subscribeRoom(), realtime in chat room is not working, like updateRoom, message status (read & deliver), user online and user typing.