mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-08-21 13:27:17 +02:00
Update Ghostgram features
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user