Fixed App Groups
This commit is contained in:
@@ -589,6 +589,7 @@
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = GIFCollectorShare/GIFCollectorShare.entitlements;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = YES;
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
@@ -617,6 +618,7 @@
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = GIFCollectorShare/GIFCollectorShare.entitlements;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = YES;
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import Foundation
|
||||
|
||||
|
||||
|
||||
// Removed SwiftData dependency to ensure compatibility across targets
|
||||
struct GIF: Codable, Identifiable, Equatable {
|
||||
let id: UUID
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<dict>
|
||||
<key>com.apple.security.application-groups</key>
|
||||
<array>
|
||||
<string>group.gifcollector</string>
|
||||
<string>group.com.abunchofknowitalls.GIFCollector</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import Foundation
|
||||
import UIKit
|
||||
|
||||
var appGroupID = "group."+Bundle.main.bundleIdentifier.unsafelyUnwrapped
|
||||
|
||||
class GIFFileManager {
|
||||
static let shared = GIFFileManager()
|
||||
|
||||
@@ -12,9 +14,6 @@ class GIFFileManager {
|
||||
|
||||
// Always use the App Group container for consistent storage between extensions
|
||||
private var documentsDirectory: URL {
|
||||
// Use a constant app group ID to ensure consistency across targets
|
||||
let appGroupID = "group.gifcollector"
|
||||
|
||||
if let containerURL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: appGroupID) {
|
||||
return containerURL
|
||||
} else {
|
||||
@@ -162,7 +161,7 @@ class GIFFileManager {
|
||||
let fileURLs = try FileManager.default.contentsOfDirectory(at: gifsDirectory, includingPropertiesForKeys: nil)
|
||||
|
||||
// Find any shared GIF that matches our URL (usually won't find any, but helps avoid duplicates)
|
||||
let userDefaults = UserDefaults(suiteName: "group.gifcollector")
|
||||
let userDefaults = UserDefaults(suiteName: appGroupID)
|
||||
if let pendingGIFs = userDefaults?.array(forKey: "pendingGIFs") as? [[String: Any]] {
|
||||
for gifInfo in pendingGIFs {
|
||||
if let originURL = gifInfo["originalURL"] as? String,
|
||||
|
||||
@@ -4,8 +4,7 @@ class GIFStorageService {
|
||||
static let shared = GIFStorageService()
|
||||
|
||||
// Use constant App Group ID to ensure consistency across targets
|
||||
private let appGroupID = "group.gifcollector"
|
||||
private let userDefaults = UserDefaults(suiteName: "group.gifcollector")
|
||||
private let userDefaults = UserDefaults(suiteName: appGroupID)
|
||||
|
||||
// Use a consistent key for saved GIFs across all extensions
|
||||
private let savedGIFsKey = "sharedGIFs"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<dict>
|
||||
<key>com.apple.security.application-groups</key>
|
||||
<array>
|
||||
<string>group.gifcollector</string>
|
||||
<string>group.com.abunchofknowitalls.GIFCollector</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<dict>
|
||||
<key>com.apple.security.application-groups</key>
|
||||
<array>
|
||||
<string>group.gifcollector</string>
|
||||
<string>group.com.abunchofknowitalls.GIFCollector</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -17,7 +17,7 @@ class ShareViewController: SLComposeServiceViewController {
|
||||
private var debugMessages: [String] = []
|
||||
|
||||
// Use the same constants as in the main app
|
||||
private let appGroupID = "group.gifcollector"
|
||||
private let appGroupID = "group."+Bundle.main.bundleIdentifier.unsafelyUnwrapped
|
||||
private let pendingGIFsKey = "pendingGIFs"
|
||||
|
||||
override func viewDidLoad() {
|
||||
|
||||
Reference in New Issue
Block a user