Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Swift][Pod] Add macOS support #512

Open
EddieLukeAtmey opened this issue Feb 14, 2023 · 5 comments
Open

[Swift][Pod] Add macOS support #512

EddieLukeAtmey opened this issue Feb 14, 2023 · 5 comments

Comments

@EddieLukeAtmey
Copy link

EddieLukeAtmey commented Feb 14, 2023

Hi, I'm having an iOS SwiftUI chat app that is using LibSignalClient. Everything works fine until I have a request to make this app work on MacOS (to build a desktop app, later implement it on windows).

At first, I tried to set multiple-platform on my current target, which caused a few problems since cocoapods doesn't support multiple-platform on a single target yet. Then I separated the target into new ones, specific to iOS and MacOS. My pod file looks like this (simplified)

def shared
	pod 'LibSignalClient', git: 'https://github.com/signalapp/libsignal.git'
	pod 'SignalCoreKit', git: 'https://github.com/signalapp/SignalCoreKit.git'
end

target 'MyApp' do
	# Pods for iOS
	platform :ios, '15.0'
	shared
end

target 'MyApp-mac' do
	# Pods for Mac
	platform :osx, '11.0'
	shared
end

Then I run pod install and got this error:

The platform of the target `MyApp-mac` (macOS 11.0) is not compatible with `LibSignalClient (0.21.1)`, which does not support `macOS`.

Does this mean it's impossible to develop this idea using SignalProtocol? Otherwise, what should I do next?

@EddieLukeAtmey EddieLukeAtmey closed this as not planned Won't fix, can't repro, duplicate, stale Feb 14, 2023
@EddieLukeAtmey
Copy link
Author

EddieLukeAtmey commented Feb 14, 2023

I closed because I thought this repo might help but after reading for a while, I'm not sure how to integrate the libSignal, so I reopened it again.

@jrose-signal
Copy link
Contributor

I think we can add macOS support to the Podfile. It won't be officially supported because it's not one of Signal's app platforms (our Mac app uses Electron), but it should work. You'll have to build the Rust parts yourself, though (and the simplest way to do that is to check out this repo and use it as a development pod).

I can't promise when I'll get to this, but it shouldn't be too hard. If you want to play with it yourself and send a PR that could speed things along.

@TechAssissinDarkness
Copy link

The error message you received is indicating that LibSignalClient does not currently support MacOS, which means that you won't be able to use it for your MacOS target. However, this does not necessarily mean that your idea is impossible to develop using SignalProtocol.

One possible solution is to use a different library that supports both iOS and MacOS. You could consider using the SignalProtocolSwift library, which is the successor to LibSignalClient. SignalProtocolSwift is a native Swift implementation of the Signal Protocol, and it supports both iOS and MacOS platforms.

To use SignalProtocolSwift, you can add the following line to your Podfile:

pod 'SignalProtocolSwift', '~> 3.1.0'

Then run pod install again to install the library.

Keep in mind that SignalProtocolSwift has a different API than LibSignalClient, so you will need to update your code accordingly. But this should allow you to support both iOS and MacOS platforms in your chat app.

Hi, I'm having an iOS SwiftUI chat app that is using LibSignalClient. Everything works fine until I have a request to make this app work on MacOS (to build a desktop app, later implement it on windows).

At first, I tried to set multiple-platform on my current target, which caused a few problems since cocoapods doesn't support multiple-platform on a single target yet. Then I separated the target into new ones, specific to iOS and MacOS. My pod file looks like this (simplified)

def shared
	pod 'LibSignalClient', git: 'https://github.com/signalapp/libsignal.git'
	pod 'SignalCoreKit', git: 'https://github.com/signalapp/SignalCoreKit.git'
end

target 'MyApp' do
	# Pods for iOS
	platform :ios, '15.0'
	shared
end

target 'MyApp-mac' do
	# Pods for Mac
	platform :osx, '11.0'
	shared
end

Then I run pod install and got this error:

The platform of the target `MyApp-mac` (macOS 11.0) is not compatible with `LibSignalClient (0.21.1)`, which does not support `macOS`.

Does this mean it's impossible to develop this idea using SignalProtocol? Otherwise, what should I do next?

@stale
Copy link

stale bot commented Jul 12, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 12, 2023
@jrose-signal jrose-signal changed the title [Swift][Pod] The platform of the target (macOS 11.0) is not compatible with LibSignalClient (0.21.1), which does not support macOS. [Swift][Pod] Add macOS support Jul 12, 2023
@jrose-signal
Copy link
Contributor

I'm leaving this open but acknowledging that Signal probably won't end up working on it; with the changes in v0.22.0 (which came out just before this issue was filed) you'd still have to build the Rust part yourself rather than using the prebuilds Signal has. (PRs still welcome to enable that, but that's probably less generally useful than what the original filer was hoping.)

The Signal prebuilds do currently include Mac Catalyst slices, but we don't promise to keep those up either; Mac Catalyst is one of the things that ties us to using Rust nightly compilers, and if we solve all the other things keeping us on nightly I don't think we'd keep publishing Mac Catalyst slices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants