{"id":230691,"date":"2021-04-05T17:20:59","date_gmt":"2021-04-05T17:20:59","guid":{"rendered":"https:\/\/holonext.com\/arview\/"},"modified":"2022-06-01T12:44:08","modified_gmt":"2022-06-01T12:44:08","slug":"arview","status":"publish","type":"page","link":"https:\/\/holonext.com\/tr\/arview\/","title":{"rendered":""},"content":{"rendered":"<p><script src=\"https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/3.5.1\/jquery.min.js\"><\/script><br \/>\n<script>\n      const urlParams = new URLSearchParams(window.location.search);\n      const sceneId = urlParams.get(\"id\");\n      const linkToRedirect = urlParams.get(\"link\");\n      function getMobileOperatingSystem() {\n      var userAgent = navigator.userAgent || navigator.vendor || window.opera;\n        \/\/ Windows Phone must come first because its UA also contains \"Android\"\n        if (\/windows phone\/i.test(userAgent)) {\n          return \"Windows Phone\";\n        }\n        if (\/android\/i.test(userAgent)) {\n          return \"Android\";\n        }\n        \/\/ iOS detection from: http:\/\/stackoverflow.com\/a\/9039885\/177710\n        if (\n          (\/iPad|iPhone|iPod\/.test(userAgent) && !window.MSStream) ||\n          (userAgent.includes(\"Mac\") && \"ontouchend\" in document)\n        ) {\n          return \"iOS\";\n        }\n        return \"unknown\";\n      }\n      function makeApiRequest() {\n        const Host = \"https:\/\/holonext.azurewebsites.net\";\n        const apiUri = \"\/api\/v1\/scene\/checkModelWithSceneId\";\n        const data = { sceneId: sceneId };\n        return fetch(Host + apiUri, {\n          method: \"post\",\n          headers: {\n            \"Content-Type\": \"application\/json\",\n          },\n          body: JSON.stringify(data),\n        })\n          .then((response) => response.json())\n          .then((jsonResponse) => {\n            return jsonResponse;\n          })\n          .catch((err) => console.log(err));\n      }\n      function createAndroidLink(glbModel, title, sound) {\n        const androidLink = document.createElement(\"a\");\n        androidLink.id = \"test-android\";\n        androidLink.href = `intent:\/\/arvr.google.com\/scene-viewer\/1.0?file=${glbModel}&mode=ar_preferred&title=${title}${\n          sound ? `&sound=${sound}` : \"\"\n        }#Intent;scheme=https;package=com.google.ar.core;action=android.intent.action.VIEW;S.browser_fallback_url=https:\/\/developers.google.com\/ar;end;`;\n        document.body.appendChild(androidLink);\n      }\n      function clickAndroidLink() {\n        $(document).ready(function () {\n          $(\"#test-android\")[0].click(function () {});\n        });\n      }\n      function createIosLink(usdzModel) {\n        const iosLink = document.createElement(\"a\");\n        iosLink.id = \"test-ios\";\n        iosLink.rel = \"ar\";\n        iosLink.href = usdzModel;\n        const dummyImage = document.createElement(\"img\");\n        iosLink.appendChild(dummyImage);\n        document.body.appendChild(iosLink);\n      }\n      function clickIosLink() {\n        $(document).ready(function () {\n          $(\"#test-ios\")[0].click(function () {});\n        });\n      }\n      const operatingSystem = getMobileOperatingSystem();\n      const variantFileUrl =\n        \"https:\/\/holonext.azurewebsites.net\/api\/v1\/scene\/variantFile\/\" +\n        sceneId +\n        \"\/\" +\n        decodeURIComponent(linkToRedirect);\n      if (operatingSystem === \"Android\") {\n        makeApiRequest().then((response) => {\n          if (response && response.body && response.body.glbModel) {\n            createAndroidLink(\n              linkToRedirect ? variantFileUrl + \".glb\" : response.body.glbModel,\n              response.body.title,\n              response.body.sound\n            );\n            clickAndroidLink();\n          }\n        });\n      } else if (operatingSystem === \"iOS\") {\n        makeApiRequest().then((response) => {\n          if (response && response.body && response.body.usdzModel) {\n            createIosLink(\n              linkToRedirect\n                ? variantFileUrl + \".usdz\"\n                : response.body.usdzModel\n            );\n            clickIosLink();\n          }\n        });\n      }\n    <\/script><\/p>\n<h2><\/h2>\n<p>&nbsp;<\/p>\n<h1 style=\"text-align: center;\"><strong>Welcome to HoloNext WebAR experience<\/strong><\/h1>\n<h4 style=\"text-align: center;\">Web-based Augmented Reality (AR) experience only works in ARCore and ARKit supported devices. If your mobile device doesn&#8217;t support Augmented Reality (AR) features, you will be directed to HoloNext homepage.<\/h4>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Welcome to HoloNext WebAR experience Web-based Augmented Reality (AR) experience only works in ARCore and ARKit supported devices. If your mobile device doesn&#8217;t support Augmented Reality (AR) features, you will be directed to HoloNext homepage. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"off","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"class_list":["post-230691","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/holonext.com\/tr\/wp-json\/wp\/v2\/pages\/230691","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/holonext.com\/tr\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/holonext.com\/tr\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/holonext.com\/tr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/holonext.com\/tr\/wp-json\/wp\/v2\/comments?post=230691"}],"version-history":[{"count":5,"href":"https:\/\/holonext.com\/tr\/wp-json\/wp\/v2\/pages\/230691\/revisions"}],"predecessor-version":[{"id":231417,"href":"https:\/\/holonext.com\/tr\/wp-json\/wp\/v2\/pages\/230691\/revisions\/231417"}],"wp:attachment":[{"href":"https:\/\/holonext.com\/tr\/wp-json\/wp\/v2\/media?parent=230691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}