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
487a7826
Commit
487a7826
authored
Apr 17, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
点击推送 跳转 消息列表
parent
f140bcff
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
12 deletions
+18
-12
Applegate(JPush).swift
galaxy/galaxy/Applegate(JPush).swift
+5
-2
YHTabBarViewController.swift
galaxy/galaxy/Classes/Base/C/YHTabBarViewController.swift
+0
-7
YHStartPageViewController.swift
...lasses/Modules/Home(首页)/C/YHStartPageViewController.swift
+8
-0
YHLoginManager.swift
...axy/Classes/Modules/Login(登录)/Server/YHLoginManager.swift
+4
-0
YHMessageListVC.swift
...alaxy/Classes/Modules/Message(消息)/C/YHMessageListVC.swift
+1
-0
YhConstant.swift
galaxy/galaxy/Classes/Tools/Helper/YhConstant.swift
+0
-3
No files found.
galaxy/galaxy/Applegate(JPush).swift
View file @
487a7826
...
...
@@ -52,8 +52,9 @@ extension AppDelegate: JPUSHRegisterDelegate {
func
application
(
_
application
:
UIApplication
,
didReceiveRemoteNotification
userInfo
:
[
AnyHashable
:
Any
],
fetchCompletionHandler
completionHandler
:
@escaping
(
UIBackgroundFetchResult
)
->
Void
)
{
JPUSHService
.
handleRemoteNotification
(
userInfo
)
completionHandler
(
UIBackgroundFetchResult
.
newData
)
// 转换到消息tab
NotificationCenter
.
default
.
post
(
name
:
YhConstant
.
YhNotification
.
didSwithToMsgTabNotification
,
object
:
nil
)
YHLoginManager
.
shared
.
needJumpToMsgTabFlag
=
true
}
...
...
@@ -82,8 +83,10 @@ extension AppDelegate: JPUSHRegisterDelegate {
}
// 系统要求执行这个方法
completionHandler
()
// 转换到消息tab
NotificationCenter
.
default
.
post
(
name
:
YhConstant
.
YhNotification
.
didSwithToMsgTabNotification
,
object
:
nil
)
YHLoginManager
.
shared
.
needJumpToMsgTabFlag
=
true
}
...
...
galaxy/galaxy/Classes/Base/C/YHTabBarViewController.swift
View file @
487a7826
...
...
@@ -29,7 +29,6 @@ class YHTabBarViewController: ESTabBarController {
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(
clearAllUnreadMsg
)
,
name
:
YhConstant
.
YhNotification
.
didMarkAllMessagesReadedNotifiction
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
switchToMsgTab
)
,
name
:
YhConstant
.
YhNotification
.
didSwithToMsgTabNotification
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
getTotalUnreadMsgCount
)
,
name
:
YhConstant
.
YhNotification
.
didRequestUnreadMsgTotalCountNotification
,
object
:
nil
)
}
...
...
@@ -53,12 +52,6 @@ extension YHTabBarViewController {
printLog
(
"登出成功"
)
}
// 转换到消息tab
@objc
func
switchToMsgTab
()
{
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
8
)
{
goTabBarBy
(
tabType
:
.
message
)
}
}
@objc
func
clearAllUnreadMsg
()
{
DispatchQueue
.
main
.
async
{
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHStartPageViewController.swift
View file @
487a7826
...
...
@@ -173,5 +173,13 @@ private extension YHStartPageViewController {
let
window
=
UIApplication
.
shared
.
yhKeyWindow
()
window
?
.
rootViewController
=
tabBarController
window
?
.
makeKeyAndVisible
()
YHLoginManager
.
shared
.
needJumpToMsgTabFlag
=
true
//for test hjl
if
YHLoginManager
.
shared
.
needJumpToMsgTabFlag
{
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
0.25
,
execute
:
{
goTabBarBy
(
tabType
:
.
message
)
})
}
}
}
galaxy/galaxy/Classes/Modules/Login(登录)/Server/YHLoginManager.swift
View file @
487a7826
...
...
@@ -20,6 +20,10 @@ class YHLoginManager: NSObject {
private
override
init
()
{}
var
needJumpToMsgTabFlag
:
Bool
=
false
}
extension
YHLoginManager
{
func
isLogin
()
->
Bool
{
let
ttt
=
userModel
?
.
token
?
.
count
??
0
if
ttt
!=
0
{
...
...
galaxy/galaxy/Classes/Modules/Message(消息)/C/YHMessageListVC.swift
View file @
487a7826
...
...
@@ -90,6 +90,7 @@ class YHMessageListVC: YHBaseViewController {
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
YHLoginManager
.
shared
.
needJumpToMsgTabFlag
=
false
getUnreadMsgList
()
NotificationCenter
.
default
.
post
(
name
:
YhConstant
.
YhNotification
.
didRequestUnreadMsgTotalCountNotification
,
object
:
nil
)
...
...
galaxy/galaxy/Classes/Tools/Helper/YhConstant.swift
View file @
487a7826
...
...
@@ -200,9 +200,6 @@ extension YhConstant {
//清空所有未读消息数
public
static
let
didMarkAllMessagesReadedNotifiction
=
Notification
.
Name
(
rawValue
:
"com.yinhe.msgPage.readAll"
)
// 自动转换到消息tab
public
static
let
didSwithToMsgTabNotification
=
Notification
.
Name
(
rawValue
:
"com.yinhe.msgPage.switch"
)
// 请求消息未读总数通知
public
static
let
didRequestUnreadMsgTotalCountNotification
=
Notification
.
Name
(
rawValue
:
"com.yinhe.msgPage.unreadMsgTotal"
)
}
...
...
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