Closed wpearse closed 8 years ago
I will try later and see if WebSocket connection works for me.
I have figured out the problem with websocket. The cookie is set for /api
path, so you need to request cookie for http://demo.traccar.org/api
instead of top level http://demo.traccar.org/
.
Please check login screen layout on iPhone 4S screen. It doesn't work properly. There must be some auto-layout issue.
You were correct about the cookie path. This PR is ready for review now.
Positions are pushed to the app using the web socket, but the map only redraws all the positions every 10s on a timer. I did this because I wasn't sure what would happen if a massive amount of positions were pushed to the app quickly and repeatedly -- I wondered if maybe the app would lock up/freeze.
It doesn't sound right. The map should be updated in real time. That was the whole point of using WebSockets. Why does map re-draw on every update? You just need to add/update single marker.
OK. Just pushed a change to remove the timer, and update the map as soon as new positions are received from the web socket.
Only single markers are updated (only the ones that change), not all markers.
OK, I'll try to find time to review it later today.
Does it mean we can publish the app after the merge is done? Is anything missing?
For me personally, the only major thing I feel I need "right now" is to add the ability to change the map type (between: roads, roads + satellite imagery, and just satellite imagery).
I would also like some guidance about how the app should look/feel. I've built the UI in the app in what I think is a tidy way, but I have only used Traccar for a few weeks... you will have a much better idea about how things should work.
Changing map type can wait. It's not that important for the first version. Let me review the code and the app, merge PR, and submit the app for Apple review if everything is fine. After that we can start on other features.
Issues I found so far:
ws
or wss
. Just use regular http
schema.self.lastUpdate = dateFormatter.dateFromString(value as! String)
. I'm not able to see variables in debug mode for some reason, but I guess the issue is with date format. Make sure you are using latest version of Traccar server for testing.Trying to fix my debug issues at the moment. Not sure why it doesn't show any variable values.
Are you sure you are using Carthage dependencies correctly? I have another project and it looks completely different. I'm not a huge expert in iOS, so please correct me if I'm talking nonsense.
In my other project:
In Traccar Manager project:
I was thinking my debugging issues are somehow related to dependencies. Does debugging work for you?
By debugging you mean the symbol inspector? It works most of the time for me -- on this and other projects. When it doesn't work I assume it is just another Xcode bug :)
I've just pushed changes to:
Thanks. I'll try it in the evening.
Can you please fix the warning:
.../TraccarManager/LoginViewController.swift:48:17: 'UIAlertView' was deprecated in iOS 9.0: UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead
Everything else looks good. I think we can merge and publish it. What's the minimum iOS we can target? iOS 8?
Fixed that warning. Did your debug issues go away with those Carthage changes?
I've only tested on iOS 8 and above, so I wouldn't feel comfortable targeting anything lower.
I was playing with the app on the iPads today, and it might be nice to tweak so the app feels a bit more "at home" on the iPad. But for now, I think it is OK.
Merged. I'll try to find time tomorrow to submit the app for Apple review.
By the way, do you want me to include you as an author in the README file and license headers? If yes, do you want to add your email address there as well?
That'd be awesome. Yes please -- "Will Pearse" and w.pearse@gmail.com. Thanks!
In this PR, new features:
Known issues:
Zoom to all devices doesn't add padding around the edge of the mapIf the API is polled while you have a callout visible, the callout is closedWeb sockets don't work on my Traccar server (503)