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
顾海波
2025-03-11 19:19:58 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
cf4a0aeead65e5c9642719b1b721e1759f909fe3
cf4a0aee
2 parents
8a0a6e87
2da40365
Merge remote-tracking branch 'origin/master'
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
ios/Classes/FlutterPushPlugin.swift
ios/Classes/FlutterPushPlugin.swift
View file @
cf4a0ae
...
...
@@ -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 #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