# On Syncthing iOS port (again)

**URL:** https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964
**Category:** Development
**Created:** [January 6, 2017, 10:41am UTC](https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964 "2017-01-06T10:41:17Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![emil.stanchev](https://forum.syncthing.net/user_avatar/forum.syncthing.net/emil.stanchev/32/3281_2.png) [@emil.stanchev](https://forum.syncthing.net/u/emil.stanchev)
#### Post date: [January 6, 2017, 10:41am UTC](https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964/1 "2017-01-06T10:41:17Z")

</div>

Hi all, I’ve checked the existing threads on the forum and am aware of the threads/projects below [1].

I’d like to take a stab at starting a syncthing implementation that will work on ios.

What do you think is the best approach to look at first? – Go mobile ([github.com/golang/go/wiki/Mobile](http://github.com/golang/go/wiki/Mobile))? – Objective-C (possibly picking up/contributing to the existing objc library)? – Swift – C++

Off the top of my head, I was going to attempt a C++ library and if that succeeds, an app/UI in swift.

Disclaimer: I don’t have that much knowledge on the project, but I’m eager to gain it.

Cheers!

[1]

- fsync - closed source implementation
- incopmlete(?) obj-c library: [https://source.ind.ie/project/pulse-swift/tree/master](https://source.ind.ie/project/pulse-swift/tree/master)
- [iOS Port of Syncthing](http://forum.syncthing.net/t/ios-port-of-syncthing/5061)
- [iOS Implementation](http://forum.syncthing.net/t/ios-implementation/918)
- [iOS client: dare to beta test?](http://forum.syncthing.net/t/ios-client-dare-to-beta-test/1795)

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [January 6, 2017, 11:00am UTC](https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964/2 "2017-01-06T11:00:54Z")

</div>

> [@emil.stanchev](#):
>
> Off the top of my head, I was going to attempt a C++ libraryand if that succeeds, an app/UI in swift.

If this is what you’re the most comfortable with, that’s what I would do. When I looked at it a while back it seemed like most advanced socket programming in Swift ended up being a fairly thin layer on top of the C APIs. Doing the abstraction in C++ might make sense in that case.

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [January 6, 2017, 11:01am UTC](https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964/3 "2017-01-06T11:01:05Z")

</div>

Depends on your appetite. If you don’t want to reinvent the wheel, maybe Go Mobile is lowest effort to get something going. I suspect you could have something up and running with a few hundered lines of code, especially given gobind:

> **[Command gobind](https://godoc.org/golang.org/x/mobile/cmd/gobind)**
>
> Gobind generates language bindings that make it possible to call Go functions from Java and Objective-C.

Alternatively, a C++ solution would probably make most sense as could be reused on Android, Windows phone and whatever else comes next. You could even slap a C++ Qt UI on top of it, or have higher level bindings to the library making it easier to consume.

Plus I’d probably be interested in contributing to the C++ part, as I started working on syncthing to learn Go, and C++ is also on the list of things I’d like to have more exposure to.

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [January 6, 2017, 7:58pm UTC](https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964/4 "2017-01-06T19:58:18Z")

</div>

Or if you are feeling even more adventurous and want to learn something new, Rust?

---

<div class="post-metadata">

### Author: ![strixaluco](https://forum.syncthing.net/user_avatar/forum.syncthing.net/strixaluco/32/3134_2.png) [@strixaluco](https://forum.syncthing.net/u/strixaluco)
#### Post date: [January 11, 2017, 10:16am UTC](https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964/5 "2017-01-11T10:16:41Z")

</div>

> [@AudriusButkevicius](#):
>
> Rust

Regarding this I recalled `fsync` developer’s blog post: [iPhone Syncthing Client (or Rust in the Wild)](https://vhbit.net/blog/2015/05/13/rust-in-the-wild-ios-syncthing-client/)

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [January 11, 2017, 10:43am UTC](https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964/6 "2017-01-11T10:43:47Z")

</div>

Yeah but its closed source

---

<div class="post-metadata">

### Author: ![luckman212](https://forum.syncthing.net/user_avatar/forum.syncthing.net/luckman212/32/2951_2.png) [@luckman212](https://forum.syncthing.net/u/luckman212)
#### Post date: [January 11, 2017, 1:04pm UTC](https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964/7 "2017-01-11T13:04:08Z")

</div>

I bought fsync() but it seems development has stalled. The current version crashes frequently for me on iOS 10.x and has some shortcomings. I would really love to see an actively developed, modern Syncthing client for iOS. Is any such thing being worked on?

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [January 11, 2017, 1:34pm UTC](https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964/8 "2017-01-11T13:34:32Z")

</div>

No.

---

<div class="post-metadata">

### Author: ![luckman212](https://forum.syncthing.net/user_avatar/forum.syncthing.net/luckman212/32/2951_2.png) [@luckman212](https://forum.syncthing.net/u/luckman212)
#### Post date: [January 11, 2017, 2:37pm UTC](https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964/9 "2017-01-11T14:37:49Z")

</div>

Ok 😐Is this just seen as unimportant? I do need occasional access to my synced files and was using fsync() before but lately it is not reliably working. I hate the idea of moving back to btsync/resilio.

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [January 11, 2017, 3:08pm UTC](https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964/10 "2017-01-11T15:08:30Z")

</div>

Its most likely a rewrite in a different language and nobody wants to dedicate that much of their personal time for such a big undertaking, for pretty much no reward apart from being awesome. And then maintain feature parity/compatibility with syncthing as it moves forward.

---

<div class="post-metadata">

### Author: ![strixaluco](https://forum.syncthing.net/user_avatar/forum.syncthing.net/strixaluco/32/3134_2.png) [@strixaluco](https://forum.syncthing.net/u/strixaluco)
#### Post date: [January 12, 2017, 3:00am UTC](https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964/11 "2017-01-12T03:00:47Z")

</div>

> [@AudriusButkevicius](#):
>
> Yeah but its closed source

Yes, unfortunately.

@luckman212, did you send some reports to developer?

---

<div class="post-metadata">

### Author: ![luckman212](https://forum.syncthing.net/user_avatar/forum.syncthing.net/luckman212/32/2951_2.png) [@luckman212](https://forum.syncthing.net/u/luckman212)
#### Post date: [January 19, 2017, 3:58am UTC](https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964/12 "2017-01-19T03:58:55Z")

</div>

Yes, I have reported some bugs to the fsync() developer last year. I got a response a while back but nothing recently. It’s been a while since any updates were released, so I don’t know if he is working on fixes.

I did some napkin math:

• 20,265 active (v0.14+) users (source: [https://data.syncthing.net/](https://data.syncthing.net/))

• Assume ~12% of them have iOS devices (source: [IDC](http://www.idc.com/promo/smartphone-market-share/os))

• Assume of these 2,431 users, ~10% of them would purchase a mobile app (source: making it up)

• Of those 243 users, each pays $9.99 (fair price?)

• Of that $2,427, dev keeps 70% (Apple’s cut)

• Profit: **~ $ 1,700**

I guess it isn’t a lot of money. But depending on developer’s skill it could be a (slightly) rewarding, fun project.

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [January 19, 2017, 12:19pm UTC](https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964/13 "2017-01-19T12:19:12Z")

</div>

I rather we crowdsourced/ran a campaign for this, so those who can, can chip in more, and those who cannot afford are still able to use the end result if it ever gets there.

I’d probably make sense to write the core libraries in C++ so it could be reused.

---

<div class="post-metadata">

### Author: ![xor-gate](https://forum.syncthing.net/user_avatar/forum.syncthing.net/xor-gate/32/2934_2.png) [@xor-gate](https://forum.syncthing.net/u/xor-gate)
#### Post date: [January 19, 2017, 4:50pm UTC](https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964/14 "2017-01-19T16:50:16Z")

</div>

To be real cross-platform and bind do different languages the core could be better written in C (or C++). I have created a objective-c systray application ([github.com/xor-gate/syncthing-macosx](http://github.com/xor-gate/syncthing-macosx)) bundle for macOS but writing the whole protocol encoding/decoding in plain C is a different job (or for Apple only in Objective-C). Binding between languages is always pain. Except for integrating C into higher level languages.

The difficult part is the BEPv1 and Crypto (e.g OpenSSL or some sort) and sockets. And then you only have a library.

There is no simple solution.

---

<div class="post-metadata">

### Author: ![canton7](https://forum.syncthing.net/user_avatar/forum.syncthing.net/canton7/32/9528_2.png) [@canton7](https://forum.syncthing.net/u/canton7)
#### Post date: [January 19, 2017, 4:53pm UTC](https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964/15 "2017-01-19T16:53:18Z")

</div>

How does writing the core in objective-c make it cross-platform?

---

<div class="post-metadata">

### Author: ![xor-gate](https://forum.syncthing.net/user_avatar/forum.syncthing.net/xor-gate/32/2934_2.png) [@xor-gate](https://forum.syncthing.net/u/xor-gate)
#### Post date: [January 19, 2017, 4:54pm UTC](https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964/16 "2017-01-19T16:54:58Z")

</div>

You are right, I have corrected my comment.

---

<div class="post-metadata">

### Author: ![unhammer](https://forum.syncthing.net/user_avatar/forum.syncthing.net/unhammer/32/21455_2.png) [@unhammer](https://forum.syncthing.net/u/unhammer)
#### Post date: [March 29, 2017, 6:09pm UTC](https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964/17 "2017-03-29T18:09:26Z")

</div>

Please do 🙂 Crowdfunding campaign sounds like a good idea, too (or even just a Patreon thing).

---

<div class="post-metadata">

### Author: ![xor-gate](https://forum.syncthing.net/user_avatar/forum.syncthing.net/xor-gate/32/2934_2.png) [@xor-gate](https://forum.syncthing.net/u/xor-gate)
#### Post date: [March 29, 2017, 7:27pm UTC](https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964/18 "2017-03-29T19:27:28Z")

</div>

Hi guys,

I just had a play and fight with gomobile to generate native iOS applications from Golang. The examples just to seem work fine. I think reusing exiting code is far easier than rewriting in language X,Y or Z. If it where that easy to write a core library in a “random language” they would have been spread around github or somewhere else. Most languages are not as expressive as Golang and have finetuned tooling which don’t fight with the developer.

@calmh I know you own a mac and have a developer account to sign executables. What would you think to write the iOS part in gomobile?

For more info: [https://github.com/golang/go/wiki/Mobile#building-and-deploying-to-ios](https://github.com/golang/go/wiki/Mobile#building-and-deploying-to-ios)

Don’t shoot yourself in the foot with XCode 8 which has an known issue with the development team: [https://github.com/golang/go/issues/17407](https://github.com/golang/go/issues/17407)

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [March 29, 2017, 7:38pm UTC](https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964/19 "2017-03-29T19:38:21Z")

</div>

I think getting something to run is fairly trivial, but the bigger problem I suspect will be the inability to integrate with all the mobile things, such as battery settings, being able to run in the background and not get killed, escape the iOS sandbox for file access and so on. I don’t know if these will be actual problems, just speculating.

---

<div class="post-metadata">

### Author: ![xor-gate](https://forum.syncthing.net/user_avatar/forum.syncthing.net/xor-gate/32/2934_2.png) [@xor-gate](https://forum.syncthing.net/u/xor-gate)
#### Post date: [March 29, 2017, 7:43pm UTC](https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964/20 "2017-03-29T19:43:20Z")

</div>

Yes that is totaly true, but you can build two types of gomobile apps. A 100% native golang `.app`. And a “`Syncthing.framework`” which can be integrated and bind with Objective-C and build with Xcode which can use all native facilities. But the framework of course mapped between objective-c and golang has some performance impacts. Still the time to market is lower.

The iOS sandbox for file access probably can’t be escaped as this is security by-design.

[Next page](https://forum.syncthing.net/t/on-syncthing-ios-port-again/8964.md?page=2)
