From 47d44c048ea09d32dacb2eaccd9ade48692a3318 Mon Sep 17 00:00:00 2001 From: Max Ast Date: Sun, 4 Aug 2024 15:43:25 +0200 Subject: [PATCH] fix firebase configuration --- plugin/swift/ShareExtensionViewController.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugin/swift/ShareExtensionViewController.swift b/plugin/swift/ShareExtensionViewController.swift index 4f32f63..4e0dc56 100644 --- a/plugin/swift/ShareExtensionViewController.swift +++ b/plugin/swift/ShareExtensionViewController.swift @@ -21,7 +21,7 @@ class ShareExtensionViewController: UIViewController { super.viewDidLoad() setupLoadingIndicator() #if canImport(FirebaseCore) - if let withFirebase = Bundle.main.object(forInfoDictionaryKey: "WithFirebase") as? String, withFirebase != "NO" { + if Bundle.main.object(forInfoDictionaryKey: "WithFirebase") as? Bool ?? false { FirebaseApp.configure() } #endif @@ -369,9 +369,9 @@ class ShareExtensionViewController: UIViewController { else if let videoData = videoItem as? NSData { let fileExtension = "mov" // Using mov as default type extension let fileName = UUID().uuidString + "." + fileExtension - + let sharedDataUrl = containerUrl.appendingPathComponent("sharedData") - + if !fileManager.fileExists(atPath: sharedDataUrl.path) { do { try fileManager.createDirectory(at: sharedDataUrl, withIntermediateDirectories: true) @@ -379,9 +379,9 @@ class ShareExtensionViewController: UIViewController { print("Failed to create sharedData directory: \(error)") } } - + let persistentURL = sharedDataUrl.appendingPathComponent(fileName) - + do { try videoData.write(to: persistentURL) if var videoArray = sharedItems["videos"] as? [String] { @@ -440,4 +440,4 @@ class ShareExtensionViewController: UIViewController { completion(sharedItems.isEmpty ? nil : sharedItems) } } -} \ No newline at end of file +}