Issue with new 2.1 Activity info

I was trying to test some of the new activity info specifically info.nameOfNextPoint. But I get the following when running

Could not find symbol nameOfNextPoint.
Symbol Not Found Error
in compute ("xxxxx")
Failed invoking <symbol>
  • As with all things in ConnectIQ, you should be sure that the field you want to access exists before you access it. The simplest way to do so is to guard the code with if (info has :nameOfNextPoint).

    function onUpdate(dc) {

    var activityInfo = Activity.getActivityInfo();
    if (activityInfo has :nameOfNextPoint) {
    // the feature is supported

    if (activityInfo.nameOfNextPoint != null) {
    // there is an active course
    }
    else {
    // no active course
    }

    }
    else {
    // the feature is not supported
    }
    }


    You may also be able to check the ConnectIQ version and comparing it against the minimum version needed for the things your app uses (nameOfNextPoint is only supported with ConnectIQ 1.2.10 and later).

    function getInitialView() {

    var deviceInfo = Sys.getDeviceInfo();
    // assert(deviceInfo);

    var monkeyVersion = null;
    if (deviceInfo has :monkeyVersion) {
    monkeyVersion = deviceInfo.monkeyVersion;
    }
    else {
    monkeyVersion = [ 0, 0, 0 ];
    }

    if (monkeyVersion[0] < 1 || monkeyVersion[2] < 2 || monkeyVersion[3] < 10) {
    return [ new UnsupportedFirmwareVersionView() ];
    }
    else {
    return [ new MyAppView(), new MyAppDelegate() ];
    }
    }


    From the looks of it, this is a new feature and probably isn't fully baked. It may not have the necessary support in the simulator, but it could work on a device with firmware that had support.

    Travis