On a real devices (tested on Venu 2+ SW 17.04) Complications.exitTo() exception is thrown in CIQ watchface on Venu2+, if launching an CIQ app (widget). Built in Complications are ok (like BodyBattery). On Simulator it works correctly.
// code snippet of Ui.WatchFaceDelegate
var compAKWEA; // stored complication
var devValue; // for testing
if (Toybox has :Complications) {
var iter = Complications.getComplications();
var complication = iter.next();
while (complication != null) {
if ("AKWEA".equals(complication.shortLabel)) {
compAKWEA = complication;
}
complication = iter.next();
}
}
// code section inside onPress(evt)
try {
if (compAKWEA != null) {
devValue = compAKWEA.shortLabel; // devValue set correct to shortLabel ("AKWEA"), so correct Complication
Complications.exitTo(compAKWEA.complicationId);
}
return true;
} catch (e) {
if (devValue != null) {
devValue = devValue + "e"; // "e" is added, so exception was thrown
}
return false;
}
If onPress is executed 1st time, devValue is set to "AKWEA" (so correct Complication) but app is not started, so seems to be exitTo() is simply not executed. If onPress executed 2nd time, devValue ist set to "AKWEAe", so exception was thrown during execution of exitTo().
Important to know is, that complication is receiving data from app correctly, so subscription to Complication is working in general, it's "only" exitTo() with issues.
Permission in manifest.xml set
<iq:uses-permission id="ComplicationSubscriber"/>
Here is resource.xml of to be launched app:
<resources>
<strings>
<string id="AppName">xyz</string>
<string id="lWeatherLong">xyz</string>
<string id="lWeatherShort">AKWEA</string>
</strings>
<complications>
<complication id="0" access="public"
longLabel="@Strings.lWeatherLong"
shortLabel="@Strings.lWeatherShort"
icon="@Drawables.Complication"
glancePreview="false">
<faceIt defaultText="@Strings.AppName" />
</complication>
</complications>
</resources>
On different device than Venu2+ not tested (because I'm not owning any other devices which supports Complications)