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.
I decided to put it all into the watchface instead of recreating apps with a complication ID.
1) I wanted to link the weekcalender app to the date that shows me: last week, current week, 4 weeks ahead.
I just let the watchface create that, it's not a complex thing, just math and because I'm in control I was able to fit another row into it, yes I can't scroll through it, but I mostly use it to get a generel idea of the current timeframe (for more I still have the original IQ app or my phone).
2) I wanted to link the QR code app, instead I just put in my most used QR code as one big image, simple touch shows it, no big deal, just a 2.5kb png image.
3) I wanted to link Display My Notes, instead I created a menu accessible through Connect IQ that lets me setup one fullscreen page of text of my choosing on the press of a button (If I want to go crazy I might make it location aware and have it change based on where I am).
4) I wanted to link accuweather minutecast to the weather symbol of my watch, again drawing 2 bars that represent the next 2 hours and coloring them to show if there is rain coming for my location is not that complex. Just a datacall with numbers turned into simple draw actions.
Would be nice if adding a complication ID would be standard, but I guess I can do fine with doing it all in my watchface.
Look at Faceit. With it you can add CIQ complications and you'll see their long names. Basically, you look for complications specified as
COMPLICATION_TYPE_INVALID
Then use shortLabel/longlabel for the one ypu want, and you can get the complicationId for that.
if you check the permissions of a CIQ app, you can see if it publishes complications:
Would be nice if adding a complication ID would be standard, but I guess I can do fine with doing it all in my watchface.
I think the reason complication IDs for device apps aren't "standard" is because the idea of complications is that apps opt in to publishing complication data of some sort. The published data is the main feature (afaik), and the ability to open the associated app via long-press from the watchface is a secondary thing. I think support for complications is optional because Garmin doesn't want to force devs to publish data if it doesn't make sense for a given app.
For example, I think there's a watchface which has a sort of companion app that works as a flashlight, which can be opened via long-press on the watchface. Most devs who wrote a flashlight app might not think of publishing a complication.