|
@@ -614,7 +614,14 @@ public func sendLocalNotification(title: String, body: String) {
|
|
|
/// 打开应用设置
|
|
|
public func openAppSetting() {
|
|
|
if UIApplication.shared.canOpenURL(URL(string: UIApplication.openSettingsURLString)!) {
|
|
|
- UIApplication.shared.openURL(URL(string: UIApplication.openSettingsURLString)!)
|
|
|
+ guard let settingsUrl = URL(string: UIApplication.openSettingsURLString) else {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if UIApplication.shared.canOpenURL(settingsUrl) {
|
|
|
+ UIApplication.shared.open(settingsUrl, completionHandler: { (success) in
|
|
|
+ BFLog(message: "Settings opened: \(success)") // Prints true
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|