openhaystack icon indicating copy to clipboard operation
openhaystack copied to clipboard

Build an iOS app for tracking at any time

Open ghost opened this issue 3 years ago • 15 comments

Build an iOS app for tracking at any time

ghost avatar Mar 27 '21 08:03 ghost

Hi,

We cannot build an iOS App by now, because on iOS we would not get access to the necessary tokens to download the locations of your devices. It would only work on jailbroken iPhones.

Sn0wfreezeDev avatar Mar 27 '21 10:03 Sn0wfreezeDev

You can use altstore to distribute the ipa package to install on the iPhone device.

shadowsss avatar Mar 28 '21 05:03 shadowsss

That would allow us to install the app, but to download locations on the iPhone you would need to have access to a token that is stored in the keychain. The item is protected by an entitlement, which can only be used if the iPhone is jailbroken.

Sn0wfreezeDev avatar Mar 28 '21 07:03 Sn0wfreezeDev

You can log in apple id in the app to get the token

shadowsss avatar Mar 28 '21 15:03 shadowsss

This is not possible. We would have considered it, if it would be technically possible.

Sn0wfreezeDev avatar Mar 28 '21 16:03 Sn0wfreezeDev

There are plenty of jailbroken devices in the world. The community has been raving about the app.

vpceg avatar Apr 11 '21 20:04 vpceg

Hi @vpceg, yes it should not be very complicated to port this app to an iOS app. Most of its code is written ins SwiftUI and it should be easy to reuse it on iOS. Only the code that is currently living in the Mail Plug-In needs to be ported, which shouldn't be too complicated. As the code is open source, we are also open to Pull requests with an iOS version. 😊

Sn0wfreezeDev avatar Apr 12 '21 07:04 Sn0wfreezeDev

Okay I had some time today to go for an idea of a simple self hosted server combined with an iOS app.

You can start the server on your local Mac, expose it to the internet with ngrok and use the iOS App to show where your devices are.
The code is available here: https://github.com/Sn0wfreezeDev/openhaystack/tree/simple_server

Please see this as a first draft. I don't know if I have more time in the near future to shape it.

Sn0wfreezeDev avatar Apr 15 '21 15:04 Sn0wfreezeDev

Can you explain how to use it pls?

valeriofantozzi avatar Apr 21 '21 09:04 valeriofantozzi

Sure. As none of this is bundled or finished, you will need to clone the branch simple_server on the repository I linked above.
Then you can open the OpenHaystack Xcode project. It contains two new targets: An iOS app and an OpenHaystackServer. You can start by running the server, it will automatically host attach on port 8080. Then to make this server accessible from the outside (e.g. the iPhone app) you will need to forward the connection (either by opening a port in your router firewall) or by using a service like ngrok. I'll quickly explain ngrok, because it is simpler to use. After you installed ngrok and you are running the server, you can launch it with: ngrok http 8080. This will assign a randomly looking https url to you.

Now you can start running the iOS app on your iPhone. The iOS app has a text field which can be used to enter your own Server url. Using Universal Clipboard you can copy the URL on your Mac and paste it on your iPhone. Then you can import your accessories from the Mac app (export them as a plist first). After importing the iPhone will start fetching the location reports over your server running on your Mac. This allows you to track your devices anywhere. There are some obvious downsides:

  • Your Mac needs to be awake to answer requests
  • The app is not available in the App Store and not as an IPA to use it with AltStore (yet)

Sn0wfreezeDev avatar Apr 21 '21 10:04 Sn0wfreezeDev

Sure. As none of this is bundled or finished, you will need to clone the branch simple_server on the repository I linked above. Then you can open the OpenHaystack Xcode project. It contains two new targets: An iOS app and an OpenHaystackServer. You can start by running the server, it will automatically host attach on port 8080. Then to make this server accessible from the outside (e.g. the iPhone app) you will need to forward the connection (either by opening a port in your router firewall) or by using a service like ngrok. I'll quickly explain ngrok, because it is simpler to use. After you installed ngrok and you are running the server, you can launch it with: ngrok http 8080. This will assign a randomly looking https url to you.

Now you can start running the iOS app on your iPhone. The iOS app has a text field which can be used to enter your own Server url. Using Universal Clipboard you can copy the URL on your Mac and paste it on your iPhone. Then you can import your accessories from the Mac app (export them as a plist first). After importing the iPhone will start fetching the location reports over your server running on your Mac. This allows you to track your devices anywhere. There are some obvious downsides:

  • Your Mac needs to be awake to answer requests
  • The app is not available in the App Store and not as an IPA to use it with AltStore (yet)

I'm getting this error on my server {"error":true,"reason":"Not Found"} (http://127.0.0.1:8080) I'm running original version of mail plugin + open haystack and only compiling the simple_server app.

Does the "open haystack simple_server" + "simple server plugin" are mandatory for the simple server to run ? or could I use the "normal" ones ?

Loic760 avatar Sep 08 '21 21:09 Loic760

Hi! This project is amazing: really well done! I've been able to flash 2 beacons but I am not able to understand how to see those from my iPhone FindMy app. I can see the 2 devices from the Mac OpenHaystack application and I wanna be able to monitor the items from everywhere. Can someone explain it to me please? Thanks in advance

Diego

Furtivo360 avatar Dec 01 '21 23:12 Furtivo360

@Furtivo360 the iOS is very basic and does not really work permanently. We are working on an iOS and Android version, but we need to make sure that the access to the reports is stable

Sn0wfreezeDev avatar Dec 02 '21 09:12 Sn0wfreezeDev

@Sn0wfreezeDev thanks for your reply :) Keep up the good job! 👍

Furtivo360 avatar Dec 02 '21 09:12 Furtivo360

Hey Guys,

Im trying to use Simple Server following the above guidance based on; https://github.com/Sn0wfreezeDev/openhaystack/tree/simple_server, however, i cant even see in the source the mention on the simple_server anymore. Ive also had a look at similar questions and cant see anything helpful.

Additionally, when I try to install Xcode on Big Sur, i'm faced with 'Xcode can't be installed on "Macintosh HD" because MacOS version 12.5 or later is required.'

Is there a more detailed guide for setting up simple_server?

My end state is interaction with lat, long, time, device id/name in a python program.

Thanks

/// Disregard

using https://github.com/biemster/FindMy was the best solution for my end state

davesenior9 avatar Mar 06 '23 01:03 davesenior9