Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
2d9667bd
Commit
2d9667bd
authored
Apr 17, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 消息
parent
7e6b0894
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
Applegate(JPush).swift
galaxy/galaxy/Applegate(JPush).swift
+7
-0
YHMessageListVC.swift
...alaxy/Classes/Modules/Message(消息)/C/YHMessageListVC.swift
+3
-2
YhConstant.swift
galaxy/galaxy/Classes/Tools/Helper/YhConstant.swift
+3
-0
No files found.
galaxy/galaxy/Applegate(JPush).swift
View file @
2d9667bd
...
@@ -77,6 +77,13 @@ extension AppDelegate: JPUSHRegisterDelegate {
...
@@ -77,6 +77,13 @@ extension AppDelegate: JPUSHRegisterDelegate {
}
}
// 需要执行这个方法,选择是否提醒用户,有Badge、Sound、Alert三种类型可以选择设置
// 需要执行这个方法,选择是否提醒用户,有Badge、Sound、Alert三种类型可以选择设置
completionHandler
(
Int
(
UNNotificationPresentationOptions
.
alert
.
rawValue
))
completionHandler
(
Int
(
UNNotificationPresentationOptions
.
alert
.
rawValue
))
// 显示通知时需要刷新消息列表和消息未读总数
DispatchQueue
.
main
.
async
{
// 请求消息未读总数通知
NotificationCenter
.
default
.
post
(
name
:
YhConstant
.
YhNotification
.
didRequestUnreadMsgTotalCountNotification
,
object
:
nil
)
// 请求消息列表通知
NotificationCenter
.
default
.
post
(
name
:
YhConstant
.
YhNotification
.
didRequestUnreadMsgListNotification
,
object
:
nil
)
}
}
}
func
jpushNotificationCenter
(
_
center
:
UNUserNotificationCenter
,
didReceive
response
:
UNNotificationResponse
,
withCompletionHandler
completionHandler
:
(()
->
Void
))
{
func
jpushNotificationCenter
(
_
center
:
UNUserNotificationCenter
,
didReceive
response
:
UNNotificationResponse
,
withCompletionHandler
completionHandler
:
(()
->
Void
))
{
...
...
galaxy/galaxy/Classes/Modules/Message(消息)/C/YHMessageListVC.swift
View file @
2d9667bd
...
@@ -93,7 +93,7 @@ class YHMessageListVC: YHBaseViewController {
...
@@ -93,7 +93,7 @@ class YHMessageListVC: YHBaseViewController {
YHLoginManager
.
shared
.
needJumpToMsgTabFlag
=
false
YHLoginManager
.
shared
.
needJumpToMsgTabFlag
=
false
getUnreadMsgList
()
getUnreadMsgList
()
NotificationCenter
.
default
.
post
(
name
:
YhConstant
.
YhNotification
.
didRequestUnreadMsgTotalCountNotification
,
object
:
nil
)
NotificationCenter
.
default
.
post
(
name
:
YhConstant
.
YhNotification
.
didRequestUnreadMsgTotalCountNotification
,
object
:
nil
)
}
}
func
setupUI
()
{
func
setupUI
()
{
...
@@ -115,6 +115,7 @@ class YHMessageListVC: YHBaseViewController {
...
@@ -115,6 +115,7 @@ class YHMessageListVC: YHBaseViewController {
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
loginSuccess
)
,
name
:
YhConstant
.
YhNotification
.
didLoginSuccessNotifiction
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
loginSuccess
)
,
name
:
YhConstant
.
YhNotification
.
didLoginSuccessNotifiction
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
logoutSuccess
)
,
name
:
YhConstant
.
YhNotification
.
didLogoutSuccessNotifiction
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
logoutSuccess
)
,
name
:
YhConstant
.
YhNotification
.
didLogoutSuccessNotifiction
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
getUnreadMsgList
)
,
name
:
YhConstant
.
YhNotification
.
didRequestUnreadMsgListNotification
,
object
:
nil
)
}
}
...
@@ -127,7 +128,7 @@ class YHMessageListVC: YHBaseViewController {
...
@@ -127,7 +128,7 @@ class YHMessageListVC: YHBaseViewController {
}
}
func
getUnreadMsgList
()
{
@objc
func
getUnreadMsgList
()
{
self
.
viewModel
.
getUnreadMsgList
{
self
.
viewModel
.
getUnreadMsgList
{
[
weak
self
]
success
,
error
in
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
...
...
galaxy/galaxy/Classes/Tools/Helper/YhConstant.swift
View file @
2d9667bd
...
@@ -202,5 +202,8 @@ extension YhConstant {
...
@@ -202,5 +202,8 @@ extension YhConstant {
// 请求消息未读总数通知
// 请求消息未读总数通知
public
static
let
didRequestUnreadMsgTotalCountNotification
=
Notification
.
Name
(
rawValue
:
"com.yinhe.msgPage.unreadMsgTotal"
)
public
static
let
didRequestUnreadMsgTotalCountNotification
=
Notification
.
Name
(
rawValue
:
"com.yinhe.msgPage.unreadMsgTotal"
)
// 请求消息未读列表通知
public
static
let
didRequestUnreadMsgListNotification
=
Notification
.
Name
(
rawValue
:
"com.yinhe.msgPage.unreadList"
)
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment