Skip to content

Commit 7474bcb

Browse files
jt9897253cbaker6
andauthored
Workaround for empty main bundle identifier on Linux (#64)
* On Linux, Bundle.main.bundleIdentifier is nil. Create custom bundle identifier instead. * Use same bundle identifer prefix on Linux as on macOS * Enable Linux CI to see what breaks * Update ci.yml Co-authored-by: jt <> Co-authored-by: Corey <[email protected]>
1 parent 80802c5 commit 7474bcb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Sources/ParseSwift/Storage/ParseFileManager.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,19 @@ internal struct ParseFileManager {
8383
}
8484

8585
init?() {
86+
#if os(Linux)
87+
guard let applicationId = ParseConfiguration.applicationId else {
88+
return nil
89+
}
90+
applicationIdentifier = "com.parse.ParseSwift.\(applicationId)"
91+
#else
8692
if let identifier = Bundle.main.bundleIdentifier {
8793
applicationIdentifier = identifier
8894
} else {
8995
return nil
9096
}
97+
#endif
98+
9199
applicationGroupIdentifer = nil
92100
}
93101

0 commit comments

Comments
 (0)