document details buttons
authorChristian Weiske <[email protected]>
Fri, 29 Nov 2019 21:24:31 +0000 (22:24 +0100)
committerChristian Weiske <[email protected]>
Fri, 29 Nov 2019 21:24:31 +0000 (22:24 +0100)
api/devs.ouya.tv/api-v1-details.response-button-appdetails.json [new file with mode: 0644]
api/devs.ouya.tv/api-v1-details.response-button-switchable.json [new file with mode: 0644]
api/devs.ouya.tv/api-v1-details.response-button-url.json [new file with mode: 0644]
api/devs.ouya.tv/api-v1-details.response-unlisted.json [new file with mode: 0644]
api/devs.ouya.tv/api-v1-details.rst

diff --git a/api/devs.ouya.tv/api-v1-details.response-button-appdetails.json b/api/devs.ouya.tv/api-v1-details.response-button-appdetails.json
new file mode 100644 (file)
index 0000000..60f01f9
--- /dev/null
@@ -0,0 +1,12 @@
+{
+    "type": "Game",
+    "title": "Bloo Kid 2",
+    "buttons": [
+        {
+            "bold": false,
+            "url": "ouya://launcher/details?app=de.eiswuxe.blookid2_unlocked",
+            "text": "Show unlocked"
+        }
+    ],
+    ...
+}
diff --git a/api/devs.ouya.tv/api-v1-details.response-button-switchable.json b/api/devs.ouya.tv/api-v1-details.response-button-switchable.json
new file mode 100644 (file)
index 0000000..cc1d105
--- /dev/null
@@ -0,0 +1,15 @@
+{
+    "type": "Game",
+    "title": "Bloo Kid 2",
+    "buttons": [
+        {
+            "bold": false,
+            "status_url": "http://example.org/activation-status",
+            "url": "http://example.org/activate",
+            "off_url": "http://example.org/deactivate",
+            "text": "Activate feature",
+            "on_text": "Deactivate feature"
+        }
+    ],
+    ...
+}
diff --git a/api/devs.ouya.tv/api-v1-details.response-button-url.json b/api/devs.ouya.tv/api-v1-details.response-button-url.json
new file mode 100644 (file)
index 0000000..4b62915
--- /dev/null
@@ -0,0 +1,12 @@
+{
+    "type": "Game",
+    "title": "Bloo Kid 2",
+    "buttons": [
+        {
+            "bold": false,
+            "url": "http://cweiske.de/",
+            "text": "Open developer page"
+        }
+    ],
+    ...
+}
diff --git a/api/devs.ouya.tv/api-v1-details.response-unlisted.json b/api/devs.ouya.tv/api-v1-details.response-unlisted.json
new file mode 100644 (file)
index 0000000..b412ad3
--- /dev/null
@@ -0,0 +1,6 @@
+{
+  "error": {
+    "message": "Unknown application",
+    "code": 2005
+  }
+}
index 6a3db0330c2a72a6a409f2ba9b872435444be1a6..724c156bb663a75b64b1f761cb62740b4af542a7 100644 (file)
@@ -7,6 +7,10 @@ Detail page for an app bundle.
 Also used as detail page for installed games when opened through
 the "Play" section.
 
+If there are no details available, the error code 2005 needs to be returned.
+Otherwise opening the details for an installed but unlisted game will
+fail on the OUYA.
+
 
 HTTP request
 ============
@@ -60,3 +64,46 @@ Example: Bundle
 
 A full version of that response data is available in git at
 ``api/devs.ouya.tv/api-v1-details.response-bundle-full.json``
+
+
+Example: Unlisted game
+-----------------------
+
+.. include:: api-v1-details.response-unlisted.json
+   :code:
+
+
+Buttons
+=======
+It is possible to add buttons in each of the detail types.
+
+There are two types of buttons:
+
+- Switchable buttons (on/off state)
+- URL buttons (``android.intent.action.VIEW``,
+  e.g. to open URLs or detail pages of other apps)
+
+
+Button for a detail page of an app
+----------------------------------
+.. include:: api-v1-details.response-button-appdetails.json
+   :code:
+
+Button for a website URL
+------------------------
+.. include:: api-v1-details.response-button-url.json
+   :code:
+
+Switchable button
+-----------------
+.. include:: api-v1-details.response-button-switchable.json
+   :code:
+
+When the details page is loaded, ``status_url`` is fetched.
+It needs to return ``{"status":true}`` or ``{"status":false}``.
+
+If "true" is returned, ``on_text`` is shown.
+Clicking will launch ``off_url``.
+
+If "false is returned, ``text`` is shown.
+Clicking will launch ``url``.