Update Ghostgram features

This commit is contained in:
ichmagmaus 812
2026-03-07 18:15:32 +01:00
parent 1a3303b059
commit 24a7ec39d9
902 changed files with 148295 additions and 62348 deletions
+17
View File
@@ -0,0 +1,17 @@
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
swift_library(
name = "SGAppGroupIdentifier",
module_name = "SGAppGroupIdentifier",
srcs = glob([
"Sources/**/*.swift",
]),
copts = [
"-warnings-as-errors",
],
deps = [
],
visibility = [
"//visibility:public",
],
)
@@ -0,0 +1,31 @@
import Foundation
public let FALLBACK_BASE_BUNDLE_ID: String = "app.swiftgram.ios"
public func sgBaseBundleIdentifier() -> String {
let baseBundleId: String
if let bundleId: String = Bundle.main.bundleIdentifier {
if Bundle.main.bundlePath.hasSuffix(".appex") {
if let lastDotRange: Range<String.Index> = bundleId.range(of: ".", options: [.backwards]) {
baseBundleId = String(bundleId[..<lastDotRange.lowerBound])
} else {
baseBundleId = FALLBACK_BASE_BUNDLE_ID
}
} else {
baseBundleId = bundleId
}
} else {
baseBundleId = FALLBACK_BASE_BUNDLE_ID
}
return baseBundleId
}
public func sgAppGroupIdentifier() -> String {
let result: String = "group.\(sgBaseBundleIdentifier())"
#if DEBUG
print("APP_GROUP_IDENTIFIER: \(result)")
#endif
return result
}