I've been trying to play around with some of the xml templates to add input fields, but i'm completely stumped. I mean, worse case scenario, I over-ride the element, but there has to be a better way.
Has anyone found any kind of API or syntax list for the xml? I know I'm grasping here, but it's worth a try..
There is no api documentation as such, if you have a jailbroken atv you can extract the xml schema file which will give a list of all the xml keys and attributes that are available. There is a ftp site with a ton of xml samples. ftp://209.222.29.73/apple/sample-xml/
var methods = [];
for (var m in atv)
{
if (typeof obj[m] == "function") //might even want to comment this out so we get all the objects, not just functions!
{
methods.push(m);
}
}
//put the info on screen
atv.showDialog("Debug", methods.join(","));
Depending on the implementation, this might give us insight into all the function names within the javascript atv object. After that, we just pass atv.functionname to whatever alert/dialog code we have and unless it's a native method, it should give us some code/understanding.
I was going to look into this at some point this weekend, but it's worth checking if it's been done by someone else at this point. If all we'll get is a list of "object not found" or native code, or something that the ATV won't even run, it's worth knowing if someone else tried first.
Edited twice because I'm apparently too stupid to make the code block work right.
I'm nowhere near an ATV right now, but I'm psyched. I have to ask - have you been able to pull out any code from those functions?
If I load a page in a browser on my pc - something like google.com and then type javascript:alert(window.alert) after the page load, I get a javascript alert window that says
"function alert() { [native code] }" - Obviously, this is useless.
If I do the same thing with javascript:alert(userdefinedobject.function), the alert typically just fires the entire source code back to you. This is extremely useful.
The third option is that the alert replies with [object] (or some variant) - in which case we re-run the code from the last post and replace the atv object with the child object (atv.TextEntry would be good)
So my question of the day is whether the atv object's children are native objects or not. (though the fact that you can list them is encouraging - you can't pull that off with the "Math" object, for example)
I can test when I get home, but if you've got an ATV handy, you might be able to solve this sooner than I can.
I wonder if something like this would get us anywhere... (typed by hand, I can't test this from here and it's incomplete)
function parseObject(var o)
{
var retVal = "";
for (var m in o)
{
if (typeof obj[m] == "function")
{
//maybe try to show it?
atv.showDialog("function", obj[m])
retVal += "function: " + m
}
if (typeof obj[m] == "boolean")
{
...
}
else
retVal += parseObject(obj[m])
}
return retVal;
}
Syntax could be (and probably is) completely out to lunch, but you get the idea.
Edit: The more I think about it, perhaps 3 is the ticket - maybe it's not returning anything because the object hasn't been created... Ah well. I hope you make out well, but not too well, I kind of want to play with this when I get home.
I found this online - not sure if linking is ok, so i'll post the snippet here but will supply credit where it's due if that's ok. I'll try a variation of this tonight:
The issue is that properties can be set to non-enumerable, but this works around that. I'm not sure if it's implemented on the ATV, BUT this code was confirmed tested in Safari, so that's something (or not...)
UDID is retired by Apple, as it was a way to exactly track your one unique device. It has basically replaced by IdForVendor and/or IdForAdvertiser.
Google finds a lot about this - eg. https://possiblemobile.com/2013/04/unique-identifiers/