{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-docs/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"Android","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"android","__idx":0},"children":["Android"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A native wrapper for the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/in-person-payments/pay-in-person/integration-guide/js-library"},"children":["JS library"]},", written in Kotlin, for POS applications that"," ","embed a WebView themselves rather than a browser page. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TyroClient"]}," wraps iClient in an embedded"," ","WebView under the POS's control, exposing the same functions, parameters and callbacks as the JS"," ","library."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Download the Android library:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/assets/android-tta.bbfa75f3026705c6d563479697cb9f6a091deb8d7244bb86890b5b69da90af34.fbf1555a.zip"},"children":["Android library"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before you begin development, check the certification criteria:"," ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/assets/certification_criteria_iclient_retail_hospitality.7bf0b2b5462961db882fcba1f1e9ddbec0d942cc7ee96278907994599bebf62a.d564e73d.pdf"},"children":["Certification Criteria Document"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"usage","__idx":1},"children":["Usage"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The embedded wrapper library is defined as package ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["com.tyro.androidtta"]},". Examples of how to"," ","handle receipt callbacks, request context and transaction-complete callbacks can be found in the"," ","library."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"setting-the-iclient-source","__idx":2},"children":["Setting the iClient source"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Set where the wrapper finds the iClient JavaScript library (simulator, test or production) via"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["com.tyro.androidtta > iclientSource"]},". Use a multi-endpoint array, as below, or a single value if"," ","you're only using one endpoint."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"public enum IclientSource {\n  PRODUCTION(\"https://iclient.tyro.com\"),\n  TEST(\"https://iclient.test.tyro.com\"),\n  SIMULATOR(\"https://iclientsimulator.test.tyro.com\");\n  private String url;\n  IclientSource(String url) {\n  this.url = url;\n  }\n  public String getUrl() {\n  return url;\n  }\n}\n","lang":"java"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"setting-the-api-key-pos-data-and-iclient-url-for-transactions","__idx":3},"children":["Setting the API key, POS data and iClient URL for transactions"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"tyroClient = TyroClient(webView,\n \"someApiKey\", //no API key is needed for test or simulated transactions, a real API key will be needed for production transactions\n PosProductData(\"DOMENIC’S POS COMPANY\", \"POS NAME\", \"1.1.0\"),\n IclientSource.TEST\n","lang":"java"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"headless-pairing-custom-pairing","__idx":4},"children":["Headless pairing (custom pairing)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Android's WebView component is based on Chromium. Chromium made modifications to the way"," ","third-party cookies are handled in order to increase security and privacy while giving users"," ","greater control and transparency. When apps target Android 12 (API level 31) or higher, these"," ","modifications are also included in WebView as of Android 12. Because of these changes, pairing"," ","details won't be persistent when you process a transaction if the Tyro pairing UI"," ","(",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://iclientsimulator.test.tyro.com/configuration.html#expert"]},") is loaded in a WebView to"," ","complete the pairing process — so it's mandatory for POS partners to implement pairing using the"," ","pairing API (headless pairing) instead."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-1","__idx":5},"children":["Example 1"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"PairingButton.setOnClickListener\n{\nval parameters = mutableMapOf<String,Any>()\nval mid = MID.text.toString()\nval tid = TID.text.toString()\nparameters[\"mid\"] = \"$mid\"\nparameters[\"tid\"] =\"$tid\"\ntyroClient.performOperation(\n\"pairTerminal\",\n parameters,\n{receipt -> },\n{data -> println(\"data = [$data]\")})\n}\n","lang":"java"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Android Studio Logcat output:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"console","header":{"controls":{"copy":{}}},"source":"2024-02-21 11:20:53.688 28181-28437 System.out  com.tyro.tyroclientsample  I  data = [{message=Pairing successful., status=success, integrationKey=b34fe79127d0d70b07563a94622366a8}]\n","lang":"console"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-2","__idx":6},"children":["Example 2"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"PairingButton.setOnClickListener {\n    display.text = \"\\n\\n\\tStatus:\\n\\tinProgress\\n\\n\\tMessage:\\n\\tPlease perform the \\\"Authorise POS\\\" function on your terminal\"\n    val parameters = mutableMapOf<String, Any>()\n    val mid = MID.text.toString()\n    val tid = TID.text.toString()\n    parameters[\"mid\"] = mid\n    parameters[\"tid\"] = tid\n    tyroClient.performOperation(\n        \"pairTerminal\",\n        parameters,\n        { receipt -> },\n        { data ->\n            if (data[\"status\"] == \"success\") {\n                display.text= \"\\n\\n\\tStatus:\\n\\t\" + \"${data[\"status\"]}\\n\\n\" + \"\\tMessage:\\n\\t\" +\n                            \"${data[\"message\"]}\\n\\n\" + \"\\tIntegration Key:\\n\" + \"\\t${data[\"integrationKey\"]}\"\n            }\n            else\n               {display.text= \"\\n\\n\\tStatus:\\n\\t\" + \"${data[\"status\"]}\\n\\n\" + \"\\tMessage:\\n\\t\" +\n                            \"${data[\"message\"]}\\n\\n\" + \"\\tIntegration Key:\\n\" + \"\\t${data[\"integrationKey\"]}\"}\n        }\n    )\n}\n","lang":"java"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The POS must display the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["message"]}," fields on the POS UI gracefully. The POS must"," ","store the MID, TID and integration key in the POS app's own database, and pass them when"," ","processing a transaction."]}]}]},"headings":[{"value":"Android","id":"android","depth":1},{"value":"Usage","id":"usage","depth":2},{"value":"Setting the iClient source","id":"setting-the-iclient-source","depth":2},{"value":"Setting the API key, POS data and iClient URL for transactions","id":"setting-the-api-key-pos-data-and-iclient-url-for-transactions","depth":2},{"value":"Headless pairing (custom pairing)","id":"headless-pairing-custom-pairing","depth":2},{"value":"Example 1","id":"example-1","depth":4},{"value":"Example 2","id":"example-2","depth":4}],"frontmatter":{"title":"Android","seo":{"title":"Android"}},"lastModified":"2026-09-22T01:37:20.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/in-person-payments/pay-in-person/integration-guide/js-library/android","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}