Bot releases are visible (Hide)
Published by ariefnurputranto 6 months ago
Changelog:
for example for handle new flow
extension UIChatListPresenter : QiscusCoreDelegate {
func onRefreshToken(event: QiscusRefreshTokenEvent) {
if event == .isUnauthorized {
//need to force re login or re init qiscusCore
if let deviceToken = UserDefaults.standard.getDeviceToken(){
QiscusCore.shared.removeDeviceToken(token: deviceToken, onSuccess: { (success) in
//success
}) { (error) in
}
}
QiscusCore.clearUser { (error) in
//re login or re initiate
let app = UIApplication.shared.delegate as! AppDelegate
app.auth()
}
}else if event == .isTokenExpired {
//need to call api refresh token when auto refresh token from be is false, by default is true from be
QiscusCore.shared.refreshToken { refreshToken in
} onError: { error in
}
}
}
}
Published by ariefnurputranto 7 months ago
Changelog :
Published by ariefnurputranto 11 months ago
Changelog :
Published by ariefnurputranto 11 months ago
Changelog :
Published by ariefnurputranto about 1 year ago
Changelog :
for example :
QiscusCore.shared.getAllChatRooms(showParticipant: true, showRemoved: false, showEmpty: true, page: 1, limit: 100, publishEvent: false, onSuccess: { (results, meta) in
}, onError: { (error) in
})
Published by ariefnurputranto about 1 year ago
Changelog :
Published by ariefnurputranto about 1 year ago
Changelog :
Published by ariefnurputranto almost 2 years ago
Changelog :
Published by ariefnurputranto almost 2 years ago
Changelog :
for implementation manually calling the API refresh token, can use this code.
func onRefreshToken(event: QiscusRefreshTokenEvent) {
if event == .isUnauthorized {
//need to force re login
}else if event == .isTokenExpired {
//implement call api refresh token if auto refresh token is false from BE (by default is true), request contact us for set auto refresh false
}
}
***Note :
Published by ariefnurputranto about 2 years ago
Changelog :
Published by ariefnurputranto about 2 years ago
Changelog :
for example :
QiscusCore.shared.getAllChatRooms(page: 1, limit: 50) { rooms, meta in
print("sucess get data")
} onError: { error in
// if error equal 403 print("error expired token")
//call api refreshToken
QiscusCore.shared.refreshToken { isSuccess in
print("check isSuccess =\(isSuccess)")
} onError: { error in
print("error =\(error.message)")
}
}
Published by ariefnurputranto about 2 years ago
Changelog:
Published by ariefnurputranto over 2 years ago
Improve appConfig Sync and SyncEvent
Published by ariefnurputranto about 3 years ago
Support XCode 13
Published by ariefnurputranto about 3 years ago
Changelog :
Published by ariefnurputranto about 3 years ago
Changelog :
****Note : On normal occurence, sync interval will be changed to 5 seconds from 30 seconds when realtime connection are closed
but if closeRealtimeConnection() are called, it will still on 30 seconds interval
Published by ariefnurputranto about 3 years ago
Changelog :
Example :
for open realtime conncetion
QiscusCore.openRealtimeConnection();
for close realtime connection
QiscusCore.closeRealtimeConnection();
**** Please resubscribe to chatRoom/refresh activity when using manually open realtimeConnection in chatRoom after realtimeConnection is connected from delegate QiscusConnectionDelegate
extension AppDelegate : QiscusConnectionDelegate {
func onConnected(){
NotificationCenter.default.post(name: NSNotification.Name(rawValue: "reSubscribeRoom"), object: nil)
}
}
in chatRoomViewController
let center: NotificationCenter = NotificationCenter.default
center.addObserver(self,selector: #selector(reSubscribeRoom(_:)), name: Notification.Name(rawValue: "reSubscribeRoom"),object: nil)
@objc func reSubscribeRoom(_ notification: Notification)
{
//restart viewController or reSubscribe
self.presenter.attachView(view: self)
}
Published by ariefnurputranto over 3 years ago
Changelog :
Published by ariefnurputranto over 3 years ago
Changelog:
Note : if failed to install this version
You can try this code
pod update --repo-update
Published by ariefnurputranto over 3 years ago
Changelog :
For example :
QiscusCore.shared.updateMessage(message: comment, onSuccess: { [weak self] (comment) in
}) { (error) in
}
Implement in delegate :
QiscusCoreDelegate :
func onRoomMessageUpdated(_ room: RoomModel, message: CommentModel){
//message updated
//reload your tableView from roomID
}
QiscusCoreRoomDelegate :
func onMessageUpdated(message: CommentModel) {
//message updated
//reload your tableView
}
****Note :