So I can link them to a long-press action on a watchface?
So I can link them to a long-press action on a watchface?
No, you still use Complications.exitTo() with a CIQ complication
here's onPress for a CIQ and Native complication, based on where the screen is pressed.
function onPress(evt) { var c=evt…
One more piece here is at startup. I build a list of all CIQ published complications on the device in ciqComps and allow the user to pick any one of them. (ciqCompIdx)
var cont=true; …
for an example of a app that publishes and a watchface that uses them.
They can't but they don't need to.
It seems that you are thinking of using the Complications.exitTo() function to exit to another CIQ app in WatchFaceDelegate.onPress(), but the correct solution is to use System.exitTo() instead.
No, you still use Complications.exitTo() with a CIQ complication
here's onPress for a CIQ and Native complication, based on where the screen is pressed.
function onPress(evt) {
var c=evt.getCoordinates();
var y=c[1];
if(y>view.tempStY+view.wFH && view.compCiq !=null) {
try {
Complications.exitTo(view.compCiq);
} catch(e) {}
} else if(view.compNat != null) {
try {
Complications.exitTo(view.compNat);
} catch(e) {}
}
WatchUi.requestUpdate();
return true;
}
the difference is how to get the id.
function newComp() {
myCompId=null;
myCiqId=null;
nLabel="";
sLabel="";
cLabel="";
ciqData="";
Complications.unsubscribeFromAllUpdates();
var iter = Complications.getComplications();
var complicationId = iter.next();
var ty;
var cont=true;
while (complicationId != null && cont) {
ty=complicationId.getType();
if(ty==MySettings.compType) {
myCompId=complicationId;
compNat=complicationId.complicationId;
Complications.subscribeToUpdates(myCompId.complicationId);
compData=myCompId.value;
nLabel=myCompId.longLabel;
sLabel=myCompId.shortLabel;
cT="";
cU=-1;
//cont=false;
}
if(ty==Complications.COMPLICATION_TYPE_INVALID) {
if(MySettings.ciqCompIdx>=0 && complicationId.longLabel.equals(MySettings.ciqComps[MySettings.ciqCompIdx])) {
myCiqId=complicationId;
compCiq=complicationId.complicationId;
Complications.subscribeToUpdates(myCiqId.complicationId);
ciqData=myCiqId.value;
cLabel=myCiqId.longLabel;
}
}
complicationId = iter.next();
}
Complications.registerComplicationChangeCallback(method(:compChanged));
}
(This is from one of my test apps)
Sorry, my answer was terrible on a lot of levels.
My answer might apply if the app in question doesn't publish a complication of course (but that's probably not what OP is thinking of)
EDIT: still wrong, since as KrapfenKringel pointed out, watchfaces can't call System.exitTo()
One more piece here is at startup. I build a list of all CIQ published complications on the device in ciqComps and allow the user to pick any one of them. (ciqCompIdx)
var cont=true;
while (complicationId != null && cont) {
ty=complicationId.getType();
if(ty==Complications.COMPLICATION_TYPE_INVALID) {
ciqComps.add(complicationId.longLabel);
}
complicationId = iter.next();
}Thank you, so the facts are: They can have them, and need them if you want to link them to your watchface, but almost no one bothers to do that (not even Garmin with their own ones).
Therefore I need to contact the devs of the apps I want to link to my watch-face and ask them to include one or create my own tools to replace them.
Also exitTo(intent as System.Intent) can't be called by watchfaces.
Thanks jim_m_58 I put your "published complications scanner" on my watch-face, sadly none of my IQ apps have one.