@neoskola/auto-play 0.2.12 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -73,21 +73,20 @@ class AutoPlayInterfaceController: NSObject, CPInterfaceControllerDelegate {
|
|
|
73
73
|
/// Pushes CPNowPlayingTemplate using ObjC @try/@catch to prevent crash from NSException.
|
|
74
74
|
private func pushNowPlayingTemplateSafely(animated: Bool) async -> Bool {
|
|
75
75
|
return await withCheckedContinuation { continuation in
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
76
|
+
do {
|
|
77
|
+
try ObjCExceptionCatcher.tryBlock {
|
|
78
|
+
self.interfaceController.pushTemplate(
|
|
79
|
+
CPNowPlayingTemplate.shared,
|
|
80
|
+
animated: animated
|
|
81
|
+
) { success, error in
|
|
82
|
+
if let error = error {
|
|
83
|
+
print("[AutoPlay] CPNowPlayingTemplate push completion error: \(error)")
|
|
84
|
+
}
|
|
85
|
+
continuation.resume(returning: success)
|
|
84
86
|
}
|
|
85
|
-
continuation.resume(returning: success)
|
|
86
87
|
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if !success {
|
|
90
|
-
print("[AutoPlay] CPNowPlayingTemplate push threw ObjC exception: \(pushError?.localizedDescription ?? "unknown")")
|
|
88
|
+
} catch {
|
|
89
|
+
print("[AutoPlay] CPNowPlayingTemplate push threw ObjC exception: \(error.localizedDescription)")
|
|
91
90
|
continuation.resume(returning: false)
|
|
92
91
|
}
|
|
93
92
|
}
|