Showing
1 changed file
with
13 additions
and
10 deletions
@@ -42,17 +42,20 @@ public class FlutterPushPlugin: NSObject, FlutterPlugin { | @@ -42,17 +42,20 @@ public class FlutterPushPlugin: NSObject, FlutterPlugin { | ||
42 | } | 42 | } |
43 | case "getPermission": | 43 | case "getPermission": |
44 | print("getPermission跳转设置获取权限") | 44 | print("getPermission跳转设置获取权限") |
45 | - if #available(iOS 15.0, *) { | ||
46 | - // iOS 15 及以上版本,直接跳转到通知设置页面 | ||
47 | - if let url = URL(string: "App-Prefs:NOTIFICATIONS_ID") { | ||
48 | - UIApplication.shared.open(url, options: [:], completionHandler: nil) | ||
49 | - } | ||
50 | - } else { | ||
51 | - // iOS 15 以下版本,跳转到应用的设置页面 | ||
52 | - if let url = URL(string: UIApplication.openSettingsURLString) { | ||
53 | - UIApplication.shared.open(url, options: [:], completionHandler: nil) | ||
54 | - } | 45 | + if let url = URL(string: UIApplication.openSettingsURLString) { |
46 | + UIApplication.shared.open(url, options: [:], completionHandler: nil) | ||
55 | } | 47 | } |
48 | + // if #available(iOS 15.0, *) { | ||
49 | + // // iOS 15 及以上版本,直接跳转到通知设置页面 | ||
50 | + // if let url = URL(string: "App-Prefs:NOTIFICATIONS_ID") { | ||
51 | + // UIApplication.shared.open(url, options: [:], completionHandler: nil) | ||
52 | + // } | ||
53 | + // } else { | ||
54 | + // // iOS 15 以下版本,跳转到应用的设置页面 | ||
55 | + // if let url = URL(string: UIApplication.openSettingsURLString) { | ||
56 | + // UIApplication.shared.open(url, options: [:], completionHandler: nil) | ||
57 | + // } | ||
58 | + // } | ||
56 | result(true) | 59 | result(true) |
57 | default: | 60 | default: |
58 | result(FlutterMethodNotImplemented) | 61 | result(FlutterMethodNotImplemented) |
-
Please register or login to post a comment