lighthouse_pm icon indicating copy to clipboard operation
lighthouse_pm copied to clipboard

Add support for iOS

Open jeroen1602 opened this issue 5 years ago • 21 comments
trafficstars

Since the app is made with Flutter it should be relatively easy to create a build for iOS. I however don't have the required devices to do this, so it would be nice if there was someone who could pick this up.

jeroen1602 avatar Sep 01 '20 16:09 jeroen1602

Hi @jeroen1602, first of all: Cool app! Thanks for making it free and open source! (Came here from the post on reddit :) )

I was hoping I could try to work on the iOS version of the app by only using my Macbook (with Bluetooth) and the xcode simulator because I don't own a real iOS device. Unfortunately you can not use Bluetooth in the simulator (afaik, did some quick research) :( But here are screenshots of the app running on iOS in case you have not seen it before: Screenshot 2020-09-04 at 00 26 03

Screenshot 2020-09-04 at 00 53 58

I think I saw that you have already written some code for iOS support (Bluetooth permission stuff for iOS?), right? So do you expect that there will be (many) other necessary adjustments to make it work on iOS?

If I find some time for it in the future, I'm going to try to contribute to this project :)

HeLau1337 avatar Sep 03 '20 22:09 HeLau1337

Thanks for the help. I am an Android developer myself so I have more knowledge about that platform, but form what I have been able to find about Bluetooth Low Energy on iOS is that you just get the permission from the system without any hassle.

So from my understanding all we need is someone to test the app and fix possible bugs. And for distribution we need some instructions on side loading (like this). And maybe if someone is generous they could sponsor uploading to the App store.

P.S. can you check if I did the app icon correctly?

jeroen1602 avatar Sep 04 '20 08:09 jeroen1602

Yeah, I don't really consider myself a proper iOS developer either. I made one rather basic iOS app with Swift (unpublished), without using device features like Bluetooth (or similar stuff where you'd need permissions). But I'm familiar with flutter since I have created two slightly more complex apps with flutter (focused on Android though). I thought that this knowledge (and my Macbook) could be enough to work on the iOS version of lighthouse pm.

all we need is someone to test the app and fix possible bugs.

Maybe I can borrow an iPhone from friends/family to do this...

for distribution we need some instructions on side loading [...]. And maybe if someone is generous they could sponsor uploading to the App store.

I think this going to be the real problem. Your link to these instructions on side loading an iOS app is interesting but damn... these would be quite a lot of steps to get a simple iOS app running. If someone who is not a developer and wants to sideload the app, they would need to download xcode first (around 8 GB i think). And in our case they'd probably also need to install and setup the flutter sdk... (not sure about this). So basically they need to be a flutter developer to install the lighthouse pm app, lol.

I really hate the way Apple is treating small developers who just want to publish a small (free) app. $99/year and no easy way to sideload apps (like apks).

Sorry, back to the topic... Yes, I'm seeing your app icon in the iPhone simulator. But it looks like the black lighthouse icon is not perfectly centered. Take a look:

HeLau1337 avatar Sep 04 '20 21:09 HeLau1337

Damn I was really hoping the icon would work, but I guess I should create the icon again. Unless you can do it the original SVG file is on the local_assets folder.

I was also thinking about using Flutter web and the Bluetooth web API to get past this restriction. But according to can I use it isn't supported (source). So that isn't a good route either.

jeroen1602 avatar Sep 04 '20 21:09 jeroen1602

How about this?

Used your original SVG and the Icon Set Creator App for macOS.

HeLau1337 avatar Sep 04 '20 22:09 HeLau1337

That looks like what it was supposed to look like. Thanks!

jeroen1602 avatar Sep 04 '20 22:09 jeroen1602

In the file bloc.dart there is a check for the iOS system version, that I couldn't test. It would be appreciated if anyone can test this and fix it if needed.

jeroen1602 avatar Sep 30 '20 18:09 jeroen1602

Hey guys, thanks for your work. Is this still WIP?

AdlerXiviD avatar Feb 10 '21 10:02 AdlerXiviD

Well the app seems to work correctly on iOS. The problem is that I have no way of building for it and I'm not planning on paying the 100 euro a year developer program fee.

So if you are able to do this, you are free to do so.

jeroen1602 avatar Feb 10 '21 11:02 jeroen1602

@AdlerXiviD I'm not working on anything related to this issue right now, too. But as jeroen said, there's certainly some work to do regarding publishing the iOS app on the App Store.


@jeroen1602

Well the app seems to work correctly on iOS.

Were you able to test the iOS app with Bluetooth enabled? (I was not)

HeLau1337 avatar Feb 10 '21 19:02 HeLau1337

@HeLau1337 It seems I misremembered, I thought that we did test that. Though in my experience talking to iOS devs the Bluetooth stack on iOS is a bit more robust than on Android, so I'm pretty confident that it will work.

jeroen1602 avatar Feb 10 '21 19:02 jeroen1602

Have this compiled and executing on my devices. Will check functionality later tonight. Minor note: Info.plist is missing a key (NSBluetoothAlwaysUsageDescription) /value (string) pair for bluetooth usage description for the code to run.

Want a PR?

SockToy avatar Apr 15 '21 18:04 SockToy

Sure throw me a PR.

jeroen1602 avatar Apr 15 '21 18:04 jeroen1602

Hey guys, quick question. Does the website build actually work? I just installed a Bluetooth Web browser (BlueFy) on my iPhone and it seems to work kinda. It recognizes the base stations, but as soon as I connect it immediately disconnects.

Only error code I can find is “unable to find characteristic that satisfies request options”

I really wanna get this to work on my iPhone :/

ghost avatar Jul 11 '21 23:07 ghost

@DerpNerb I have tried it for V2 lighthouses on Chrome for Android, Linux and Windows. I have not tried it using the BlueFy browser on an iPhone.

If you try this test site from the library are you able to get any information from your lighthouses? https://jeroen1602.github.io/flutter_web_bluetooth.

jeroen1602 avatar Jul 12 '21 10:07 jeroen1602

I built the app using xcode and installed direct. Worked fine. A while ago now though

On Sun, Jul 11, 2021 at 7:37 PM DerpNerb @.***> wrote:

Hey guys, quick question. Does the website build actually work? I just installed a Bluetooth Web browser (BlueFy) on my iPhone and as seems to work kinda. It recognizes the bad stations, but as soon as I connect it immediately disconnects.

Only error code I can find is “unable to find characteristic that satisfies request options”

I really wanna get this to work on my iPhone :/

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jeroen1602/lighthouse_pm/issues/26#issuecomment-877879205, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABOE6UEOZLPBDOZVNMFZ6A3TXITMDANCNFSM4QR46F4A .

-- @.*** - Larkin' around since 1996

SockToy avatar Jul 12 '21 12:07 SockToy

@jeroen1602 I can connect to the base stations via that site, but when connected the site won’t display anything. It’s just a slightly gray color. No errors this time around. 9301755A-2697-414B-B9D2-649CF0A03CB6

ghost avatar Jul 12 '21 22:07 ghost

@DerpNerb hmm I think that the browser may not be using the same version of the Bluetooth web spec. It looks like it may be ignoring the optional services request and thus disallowing the site to communicate with these services. But I'm not sure and it's hard for me to debug since I don't have an iOS device.

jeroen1602 avatar Jul 13 '21 08:07 jeroen1602

Hmm yeah I don’t think the Bluefy browser support every function. Though I honestly believe it’s possible another way.

I went to this site: https://googlechrome.github.io/samples/web-bluetooth/discover-services-and-characteristics.html

And connected to one of the base stations. The console shows I can read the characteristics. 3FF25C08-1222-4218-9794-F5E982DDBE44

lemme know if you want me to run more tests.

ghost avatar Jul 28 '21 08:07 ghost

fyi for easier sideloading on ios there's https://altstore.io/ so people don't need to compile it themselves

kitlith avatar Aug 06 '21 07:08 kitlith

I built the app from the master branch on my iPhone and the app "works" but it won't find any base stations

HuJohner avatar Jan 18 '22 15:01 HuJohner