Commit 96528b79 authored by Alex朱枝文's avatar Alex朱枝文

增加七鱼历史记录,以及文件跳转走safari

parent 32b83258
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
import UIKit import UIKit
import IQKeyboardManagerSwift import IQKeyboardManagerSwift
import SafariServices
class YHButlerServiceManager: NSObject { class YHButlerServiceManager: NSObject {
...@@ -18,6 +19,9 @@ class YHButlerServiceManager: NSObject { ...@@ -18,6 +19,9 @@ class YHButlerServiceManager: NSObject {
// 调整UI // 调整UI
private weak var customUIConfig = QYSDK.shared().customUIConfig() private weak var customUIConfig = QYSDK.shared().customUIConfig()
// 点击事件处理
private weak var customActionConfig = QYSDK.shared().customActionConfig()
private lazy var getUserInfoViewModel: YHButlerServiceViewModel = YHButlerServiceViewModel() private lazy var getUserInfoViewModel: YHButlerServiceViewModel = YHButlerServiceViewModel()
var lastMessage: YHButlerServiceMessage? var lastMessage: YHButlerServiceMessage?
...@@ -42,6 +46,7 @@ class YHButlerServiceManager: NSObject { ...@@ -42,6 +46,7 @@ class YHButlerServiceManager: NSObject {
let qyOption = QYSDKOption(appKey: YhConstant.QiYuSDK.appKey) let qyOption = QYSDKOption(appKey: YhConstant.QiYuSDK.appKey)
qyOption.appName = YhConstant.QiYuSDK.appName qyOption.appName = YhConstant.QiYuSDK.appName
QYSDK.shared().register(with: qyOption) QYSDK.shared().register(with: qyOption)
updateActionConfig()
/* /*
QYSDK.shared().registerPushMessageNotification { pushMessage in QYSDK.shared().registerPushMessageNotification { pushMessage in
os_log("#####registerPushMessageNotification %@ %ld %f", (pushMessage?.text ?? ""), (pushMessage?.type.rawValue ?? 0), (pushMessage?.time ?? 0)) os_log("#####registerPushMessageNotification %@ %ld %f", (pushMessage?.text ?? ""), (pushMessage?.type.rawValue ?? 0), (pushMessage?.time ?? 0))
...@@ -90,6 +95,28 @@ class YHButlerServiceManager: NSObject { ...@@ -90,6 +95,28 @@ class YHButlerServiceManager: NSObject {
} }
} }
extension YHButlerServiceManager {
// MARK: - customActionConfig
private func updateActionConfig() {
// 账号登录后是否拉取漫游消息
customActionConfig?.pullRoamMessage = true
// 拉取漫游消息条数,默认20条,最大100条
customActionConfig?.roamMessageLimit = 100
customActionConfig?.linkClickBlock = { linkAddress in
guard let linkAddress = linkAddress, (linkAddress.isValidHttpUrl || linkAddress.isValidHttpsUrl || linkAddress.isValidFileUrl), let url = URL(string: linkAddress) else {
return QYLinkClickActionPolicy.open
}
let safariViewController = SFSafariViewController(url: url)
safariViewController.dismissButtonStyle = .close
safariViewController.modalPresentationStyle = .fullScreen
UIViewController.current?.present(safariViewController, animated: true, completion: nil)
return QYLinkClickActionPolicy.cancel
}
}
}
extension YHButlerServiceManager { extension YHButlerServiceManager {
// MARK: - 常用公开方法 // MARK: - 常用公开方法
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment