thepoweroftwo / meshtastic-ios

iOS App for Meshtastic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'keyWindow' was deprecated

akvik opened this issue · comments

Hi,

first of all, thanks for this initiative - would be cool to have a ios app!

When I compile I get this warning in xcode:
'keyWindow' was deprecated in iOS 13.0: Should not be used for applications that support multiple scenes as it returns a key window across all connected scenes

in line 177:
let screenHeight = UIApplication.shared.keyWindow?.bounds.height ?? UIScreen.main.bounds.height

I'm compiling for the old iPhone SE.

Also, in the app on the phone, messages aren't sent and they don't show up in the chat window. I don't know if the warning above and this bug is connected 🙂 The app connects to my meshtastics just fine :)

You can ignore this warning. The syntax has changed in iOS 13 and I will change the appropriate code in a future version of the app. In iOS 14 the old syntax still works without problems.

The cause of your problem is difficult to see. Currently we have 71 beta testers and no one else has this issue. I can give you some suggestions what you can do.

  1. you can try to install the app with TestFlight and see what happens
  2. The app works up to device firmware 1.1.50. If you use 1.2.x it may cause some problems
  3. If your device is connected to your PC via USB and you are running a Meshtastic Python script, all output may be sent to the console window and not via the bluetooth interface. In this case you encounter the behavior you describe.

Thanks!

Yes, I use the latest meshtastic firmware - that might be the reason.

Do you mean that using the python API through USB somehow creates an issue when I later on use the iPhone app?

No there is no issue with iPhone app when using the python API before. What I described ist that when you are running a python script and subscribe to a receive event (e.g. onReceive), all output from the device will be sent to the terminal window (or console in windows) where your script is running. If you connect your iPhone via bluetooth at the same time, you don't receive any device output on the iPhone because all data is redirected to the terminal window. After stopping the python script you can reconnect your iPhone and you will get the device output via bluetooth as expected.

It's not a problem but the normal behavior of the device. I hope that helps for a better understanding. If not please feel free to write again.

Thanks, I don't think that is the issue, as the device is rebooted after I use the Python API to set region, owner etc.

I have compiled and installed the app once more, and I have updated to the latest alpha 1.2.25. Maybe the app is not compatible with the latest version of meshtastic?

As I mentioned above the current version of the app (0.87(5)) works up to the last beta version of the device firmware (1.1.50). For a test you should install that version on your device. This is because in the new alpha versions 1.2.x the protobuf structure has changed significantly.

Currently I'm working on the app version 0.88 which will support the firmware 1.2.x. I'll also put the code for parsing the protobuf into the appropriate data classes. For now it is a lot of procedural code that helped me to understand how to handle the protobuf structure. Please be patient as my time to work on the code is very limited.

Absolutely - I'll wait - thanks for your efforts! :)