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
eb7f0cb5
Commit
eb7f0cb5
authored
Apr 17, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 通知
parent
76000ba2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
YHMyNotifySettingVC.swift
...laxy/Classes/Modules/Mine(我的)/C/YHMyNotifySettingVC.swift
+41
-0
No files found.
galaxy/galaxy/Classes/Modules/Mine(我的)/C/YHMyNotifySettingVC.swift
View file @
eb7f0cb5
...
...
@@ -30,6 +30,22 @@ class YHMyNotifySettingVC: YHBaseViewController {
setupUI
()
}
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
checkNotificationAuthorizationStatus
{
[
weak
self
]
granted
in
guard
let
self
=
self
else
{
return
}
for
item
in
items
{
if
item
.
type
==
.
notify
{
item
.
enableStatus
=
granted
}
}
DispatchQueue
.
main
.
async
{
self
.
tableView
.
reloadData
()
}
}
}
func
setupUI
()
{
gk_navTitle
=
"通知设置"
.
local
view
.
backgroundColor
=
.
white
...
...
@@ -40,6 +56,31 @@ class YHMyNotifySettingVC: YHBaseViewController {
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
k_Height_TabBar
)
}
}
func
checkNotificationAuthorizationStatus
(
_
callBack
:((
Bool
)
->
())?)
{
UNUserNotificationCenter
.
current
()
.
getNotificationSettings
{
settings
in
var
enableStatus
=
false
switch
settings
.
authorizationStatus
{
case
.
authorized
:
print
(
"通知已授权"
)
enableStatus
=
true
case
.
denied
:
print
(
"通知被拒绝"
)
enableStatus
=
false
case
.
notDetermined
:
print
(
"通知权限尚未确定"
)
enableStatus
=
false
case
.
provisional
:
print
(
"通知以临时方式授权"
)
enableStatus
=
false
case
.
ephemeral
:
enableStatus
=
false
@unknown
default
:
break
}
callBack
?(
enableStatus
)
}
}
}
extension
YHMyNotifySettingVC
:
UITableViewDelegate
,
UITableViewDataSource
{
...
...
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