Skip to content

Commit

Permalink
fix firebase configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxAst committed Aug 4, 2024
1 parent f04e4fb commit 47d44c0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions plugin/swift/ShareExtensionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -369,19 +369,19 @@ 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)
} catch {
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] {
Expand Down Expand Up @@ -440,4 +440,4 @@ class ShareExtensionViewController: UIViewController {
completion(sharedItems.isEmpty ? nil : sharedItems)
}
}
}
}

0 comments on commit 47d44c0

Please sign in to comment.