Skip to content

Commit

Permalink
Workaround for empty main bundle identifier on Linux (#64)
Browse files Browse the repository at this point in the history
* 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 <coreyearleon@icloud.com>
  • Loading branch information
jt9897253 and cbaker6 authored Jan 25, 2021
1 parent 80802c5 commit 7474bcb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Sources/ParseSwift/Storage/ParseFileManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,19 @@ internal struct ParseFileManager {
}

init?() {
#if os(Linux)
guard let applicationId = ParseConfiguration.applicationId else {
return nil
}
applicationIdentifier = "com.parse.ParseSwift.\(applicationId)"
#else
if let identifier = Bundle.main.bundleIdentifier {
applicationIdentifier = identifier
} else {
return nil
}
#endif

applicationGroupIdentifer = nil
}

Expand Down

0 comments on commit 7474bcb

Please sign in to comment.