Showing
1 changed file
with
4 additions
and
2 deletions
| @@ -23,21 +23,23 @@ public class FlutterPushPlugin: NSObject, FlutterPlugin { | @@ -23,21 +23,23 @@ public class FlutterPushPlugin: NSObject, FlutterPlugin { | ||
| 23 | DispatchQueue.main.async { | 23 | DispatchQueue.main.async { |
| 24 | UIApplication.shared.registerForRemoteNotifications() | 24 | UIApplication.shared.registerForRemoteNotifications() |
| 25 | } | 25 | } |
| 26 | + result(true) | ||
| 26 | } else { | 27 | } else { |
| 27 | print("无用通知权限") | 28 | print("无用通知权限") |
| 29 | + result(false) | ||
| 28 | } | 30 | } |
| 29 | } | 31 | } |
| 30 | - result(true) | ||
| 31 | case "checkPermission": | 32 | case "checkPermission": |
| 32 | print("checkPermission检测权限") | 33 | print("checkPermission检测权限") |
| 33 | UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { granted, _ in | 34 | UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { granted, _ in |
| 34 | if granted { | 35 | if granted { |
| 35 | print("有通知权限") | 36 | print("有通知权限") |
| 37 | + result(true) | ||
| 36 | } else { | 38 | } else { |
| 37 | print("无用通知权限") | 39 | print("无用通知权限") |
| 40 | + result(false) | ||
| 38 | } | 41 | } |
| 39 | } | 42 | } |
| 40 | - result(true) | ||
| 41 | case "getPermission": | 43 | case "getPermission": |
| 42 | print("getPermission跳转设置获取权限") | 44 | print("getPermission跳转设置获取权限") |
| 43 | if #available(iOS 15.0, *) { | 45 | if #available(iOS 15.0, *) { |
-
Please register or login to post a comment