Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
flutter_push
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
zhuguoming
2025-03-06 09:43:22 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2da4036553adf203cf4f908c8f6b5fa4c11a28f9
2da40365
1 parent
0eba82ac
设置跳转修改
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
ios/Classes/FlutterPushPlugin.swift
ios/Classes/FlutterPushPlugin.swift
View file @
2da4036
...
...
@@ -42,17 +42,20 @@ public class FlutterPushPlugin: NSObject, FlutterPlugin {
}
case
"getPermission"
:
print
(
"getPermission跳转设置获取权限"
)
if
#available(iOS 15.0, *)
{
// iOS 15 及以上版本,直接跳转到通知设置页面
if
let
url
=
URL
(
string
:
"App-Prefs:NOTIFICATIONS_ID"
)
{
UIApplication
.
shared
.
open
(
url
,
options
:
[:],
completionHandler
:
nil
)
}
}
else
{
// iOS 15 以下版本,跳转到应用的设置页面
if
let
url
=
URL
(
string
:
UIApplication
.
openSettingsURLString
)
{
UIApplication
.
shared
.
open
(
url
,
options
:
[:],
completionHandler
:
nil
)
}
if
let
url
=
URL
(
string
:
UIApplication
.
openSettingsURLString
)
{
UIApplication
.
shared
.
open
(
url
,
options
:
[:],
completionHandler
:
nil
)
}
// if #available(iOS 15.0, *) {
// // iOS 15 及以上版本,直接跳转到通知设置页面
// if let url = URL(string: "App-Prefs:NOTIFICATIONS_ID") {
// UIApplication.shared.open(url, options: [:], completionHandler: nil)
// }
// } else {
// // iOS 15 以下版本,跳转到应用的设置页面
// if let url = URL(string: UIApplication.openSettingsURLString) {
// UIApplication.shared.open(url, options: [:], completionHandler: nil)
// }
// }
result
(
true
)
default
:
result
(
FlutterMethodNotImplemented
)
...
...
Please
register
or
login
to post a comment