Tuesday, January 19, 2016

Day 62

Core Location



I think one of benefits of learning the different core libraries of the iPhone is really cool, but also super frustrating. The learning platform has no chapters on core location so we do what every software engineers do...we google. Core location actually isn't that bad; there are a lot of tutorials online for using it. Import MapKit to the view controllers to be able to use all the different methods and attributes. I partnered up with Maric and we wanted to do something like FireChat. FireChat is a group messaging app that is uses bluetooth rather than cell data. Our idea was to create a map app that can ping other individual coordinates so if you're at a large concert or venue that has limited connectivity, there would be a way to find each other.

The first day we spent just messing around with how to use MapKit and figured how to zoom upon our phone's location. Maric found a beacon library that uses cell data to see how close a phone is with another phone but we scratched the idea cause we wanted something that didn't use cell data. Eventually we conceded that cell data is required and our project became just a map that can ping locations of other phones who are connected to the same server.

The set up is simple, creating a server.js file with all the sockets that we need. However, it got a bit tricky when we wanted to send in and pull out data from the phone. Remember how I said Xcode doesn't have Javascript support? Well, Everything in MapKit relies on coordinates so every time we update our location, we have to send our new coordinates to the server (which is easy), however sending it to the other phones got tricky because we couldn't pull the information out of it and it wasn't a JSON object (it was an AnyObject) so instead of adding more features to our project, we could only add annotations of other people's position. Eventually Maric found a way to parse the data that we got from the server via swiftJSON. 

No comments:

Post a Comment