Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VLTelemetryMessage fails to set location data #9

Open
dzeitman opened this issue Jan 11, 2016 · 0 comments
Open

VLTelemetryMessage fails to set location data #9

dzeitman opened this issue Jan 11, 2016 · 0 comments

Comments

@dzeitman
Copy link
Contributor

Looks like there’s some recent changes to VLTelemetryMessagePager >>> VLTelemetryMessage - so now location properties showing up  nil.   

the Dict    in VLTelemetryMessage: initWithDictionary  looks like this:

Printing description of dictionary:
{
    data =     {
        accel =         {
            maxX = "-9.806699999999999";
            maxY = "-0.383074";
            maxZ = "-1.302452";
            minX = "-9.806699999999999";
            minY = "-0.459689";
            minZ = "-1.34076";
        };
    };
    id = "102dc0bb-8fa1-4c47-b3d1-75992308b006";
    links =     {
        self = "https://telemetry.vin.li/api/v1/messages/102dc0bb-8fa1-4c47-b3d1-75992308b006?deviceId=666c19b6-ffd5-4143-995e-01ff44dda123";
    };
    timestamp = "2016-01-11T04:04:13.586Z";
}


//   The class is looking for a location object in the JSON.


 if([_data jsonObjectForKey:@"location"]) {

                    _locationType = _data[@"location"][@"type"];

                    _latitude = [_data[@"location"][@"coordinates"][1] doubleValue];
                    _longitude = [_data[@"location"][@"coordinates"][0] doubleValue];
                }

            }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant