Commit f140bcff authored by Steven杜宇's avatar Steven杜宇

// 消息

parent 8e2c6ad6
...@@ -65,8 +65,6 @@ extension AppDelegate: JPUSHRegisterDelegate { ...@@ -65,8 +65,6 @@ extension AppDelegate: JPUSHRegisterDelegate {
UNUserNotificationCenter.current().removeAllPendingNotificationRequests() UNUserNotificationCenter.current().removeAllPendingNotificationRequests()
} }
@available(iOS 10.0, *)
func jpushNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: ((Int) -> Void)) { func jpushNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: ((Int) -> Void)) {
let userInfo = notification.request.content.userInfo let userInfo = notification.request.content.userInfo
...@@ -77,7 +75,6 @@ extension AppDelegate: JPUSHRegisterDelegate { ...@@ -77,7 +75,6 @@ extension AppDelegate: JPUSHRegisterDelegate {
completionHandler(Int(UNNotificationPresentationOptions.alert.rawValue)) completionHandler(Int(UNNotificationPresentationOptions.alert.rawValue))
} }
@available(iOS 10.0, *)
func jpushNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: (() -> Void)) { func jpushNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: (() -> Void)) {
let userInfo = response.notification.request.content.userInfo let userInfo = response.notification.request.content.userInfo
if response.notification.request.trigger is UNPushNotificationTrigger { if response.notification.request.trigger is UNPushNotificationTrigger {
...@@ -85,6 +82,8 @@ extension AppDelegate: JPUSHRegisterDelegate { ...@@ -85,6 +82,8 @@ extension AppDelegate: JPUSHRegisterDelegate {
} }
// 系统要求执行这个方法 // 系统要求执行这个方法
completionHandler() completionHandler()
// 转换到消息tab
NotificationCenter.default.post(name: YhConstant.YhNotification.didSwithToMsgTabNotification, object: nil)
} }
......
...@@ -55,8 +55,8 @@ extension YHTabBarViewController { ...@@ -55,8 +55,8 @@ extension YHTabBarViewController {
// 转换到消息tab // 转换到消息tab
@objc func switchToMsgTab() { @objc func switchToMsgTab() {
DispatchQueue.main.async { DispatchQueue.main.asyncAfter(deadline: .now() + 8) {
self.selectedIndex = 2 goTabBarBy(tabType: .message)
} }
} }
......
...@@ -70,6 +70,7 @@ class YHDetailMessageModel: SmartCodable { ...@@ -70,6 +70,7 @@ class YHDetailMessageModel: SmartCodable {
var content: String = "" var content: String = ""
var time: Int = 0 var time: Int = 0
var isRead: Bool = false var isRead: Bool = false
var orderId: Int = 0
required init() { required init() {
......
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