<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How can app an detect if it is running inside AppPlayer in ArcGIS AppStudio Questions</title>
    <link>https://community.esri.com/t5/arcgis-appstudio-questions/how-can-app-an-detect-if-it-is-running-inside/m-p/774089#M581</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Erwin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a suggestion, it would be helpful if there were properties available on that Loader object similar to parent.portal that identified the Player and runtime versions. This could help with troubleshooting in certain situations, such as being able to discern which users are on older versions of Player etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;-Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 18 Jan 2020 05:01:31 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2020-01-18T05:01:31Z</dc:date>
    <item>
      <title>How can app an detect if it is running inside AppPlayer</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/how-can-app-an-detect-if-it-is-running-inside/m-p/774087#M579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I noticed the code below inside one of the AppStudio samples (Authentication sample in the SecureStorageHelper file) and it got me thinking, how can an app detect if it is running inside AppPlayer?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried dropping that code into the top level of a demo app. When running from my desktop, console logging Appframework.typeOf(parent, type) returned "RootItem". The variable isRunningInPlayer was set to false, which makes sense because the top level item ("App") didn't have a parent. If I ran that from within AppPlayer, it correctly returns isRunningInPlayer as true, but only based on the fact that the root item now actually has a parent. Because console logging out&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Appframework.typeOf(parent, type)&lt;/SPAN&gt; in this case returned "Loader" and not "AppLoader".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sooooo, can someone perhaps walk me through the logic in the code below? To my thinking, wouldn't it be enough just to test whether the root item has a parent?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Related question, is there a way that an app could (assuming it knew whether it was running in the app player or not) access and use the "portal" from the AppPlayer instead of it's own?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"&gt;&lt;SPAN style="color: #bec0c2;"&gt;       &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; color: #45c6d6;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;(&lt;SPAN style="font-style: italic;"&gt;parent&lt;/SPAN&gt;)&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;{&lt;/PRE&gt;&lt;PRE style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"&gt;&lt;SPAN style="color: #bec0c2;"&gt;            &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; color: #45c6d6;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;(&lt;SPAN style="color: #66a334;"&gt;AppFramework&lt;/SPAN&gt;.typeOf(&lt;SPAN style="font-style: italic;"&gt;parent&lt;/SPAN&gt;,&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;true)&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;===&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #d69545;"&gt;"AppLoader"&lt;/SPAN&gt;)&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;{&lt;/PRE&gt;&lt;PRE style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"&gt;&lt;SPAN style="color: #bec0c2;"&gt;                &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; color: #45c6d6;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; color: #9acfd6;"&gt;portal&lt;/SPAN&gt;&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;=&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: italic;"&gt;parent&lt;/SPAN&gt;.portal&lt;/PRE&gt;&lt;PRE style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"&gt;&lt;SPAN style="color: #bec0c2;"&gt;                &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; color: #45c6d6;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;(&lt;SPAN style="font-style: italic; color: #9acfd6;"&gt;portal&lt;/SPAN&gt;)&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;{&lt;/PRE&gt;&lt;PRE style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"&gt;&lt;SPAN style="color: #bec0c2;"&gt;                    &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; color: #a8abb0;"&gt;//console.log("####&lt;/SPAN&gt;&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; color: #a8abb0;"&gt;AppStudio&lt;/SPAN&gt;&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; color: #a8abb0;"&gt;Player&lt;/SPAN&gt;&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; color: #a8abb0;"&gt;username:&lt;/SPAN&gt;&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; color: #a8abb0;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; color: #a8abb0;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; color: #a8abb0;"&gt;portal.username)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"&gt;&lt;SPAN style="color: #bec0c2;"&gt;                    &lt;/SPAN&gt;&lt;SPAN style="font-style: italic;"&gt;isRunningInPlayer&lt;/SPAN&gt;&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;=&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;true&lt;/PRE&gt;&lt;PRE style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"&gt;&lt;SPAN style="color: #bec0c2;"&gt;                &lt;/SPAN&gt;}&lt;/PRE&gt;&lt;PRE style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"&gt;&lt;SPAN style="color: #bec0c2;"&gt;            &lt;/SPAN&gt;}&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; color: #45c6d6;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;{&lt;/PRE&gt;&lt;PRE style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"&gt;&lt;SPAN style="color: #bec0c2;"&gt;                &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; color: #a8abb0;"&gt;//console.log("####&lt;/SPAN&gt;&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; color: #a8abb0;"&gt;Different&lt;/SPAN&gt;&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; color: #a8abb0;"&gt;Player")&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"&gt;&lt;SPAN style="color: #bec0c2;"&gt;                &lt;/SPAN&gt;&lt;SPAN style="font-style: italic;"&gt;isRunningInPlayer&lt;/SPAN&gt;&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;=&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;true&lt;/PRE&gt;&lt;PRE style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"&gt;&lt;SPAN style="color: #bec0c2;"&gt;            &lt;/SPAN&gt;}&lt;/PRE&gt;&lt;PRE style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"&gt;&lt;SPAN style="color: #bec0c2;"&gt;        &lt;/SPAN&gt;}&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; color: #45c6d6;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;{&lt;/PRE&gt;&lt;PRE style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"&gt;&lt;SPAN style="color: #bec0c2;"&gt;            &lt;/SPAN&gt;&lt;SPAN style="font-style: italic;"&gt;isRunningInPlayer&lt;/SPAN&gt;&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;=&lt;SPAN style="color: #bec0c2;"&gt; &lt;/SPAN&gt;false&lt;/PRE&gt;&lt;PRE style="-qt-block-indent: 0; text-indent: 0px; margin: 0px;"&gt;&lt;SPAN style="color: #bec0c2;"&gt;        &lt;/SPAN&gt;}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2020 01:28:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/how-can-app-an-detect-if-it-is-running-inside/m-p/774087#M579</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-01-17T01:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can app an detect if it is running inside AppPlayer</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/how-can-app-an-detect-if-it-is-running-inside/m-p/774088#M580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Paul,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are correct, that&amp;nbsp;is how you detect if an app is running inside AppStudio Player, and the correct one is&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;AppFramework.typeOf(parent, true) === "Loader" as of AppStudio Player 4.1.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Having a parent means that, this component is being loaded by a Loader, in this case, it is an AppStudio Player.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Accessing parent.portal in an app&amp;nbsp;that is running inside AppStudio Player should work and it was working in the previous version, but there is an issue with accessing the parent.portal in AppStudio Player 4.1, thank you for pointing it out! We are working on getting this fixed for AppStudio Player 4.2 that is scheduled for Dev Summit 2020. Feel free to submit an official bug with &lt;A href="https://community.esri.com/group/1759"&gt;Esri Technical Support&lt;/A&gt;‌ if you want to have it tracked.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thank you,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Erwin.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jan 2020 02:20:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/how-can-app-an-detect-if-it-is-running-inside/m-p/774088#M580</guid>
      <dc:creator>ErwinSoekianto</dc:creator>
      <dc:date>2020-01-18T02:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: How can app an detect if it is running inside AppPlayer</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/how-can-app-an-detect-if-it-is-running-inside/m-p/774089#M581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Erwin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a suggestion, it would be helpful if there were properties available on that Loader object similar to parent.portal that identified the Player and runtime versions. This could help with troubleshooting in certain situations, such as being able to discern which users are on older versions of Player etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;-Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jan 2020 05:01:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/how-can-app-an-detect-if-it-is-running-inside/m-p/774089#M581</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-01-18T05:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: How can app an detect if it is running inside AppPlayer</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/how-can-app-an-detect-if-it-is-running-inside/m-p/774090#M582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the ArcGIS Runtime version, you can check by using calling &lt;A href="https://developers.arcgis.com/qt/latest/qml/api-reference/qml-esri-arcgisruntime-arcgisruntimeenvironment.html#version-prop"&gt;ArcGISRuntimeEnvironment.version&lt;/A&gt; on the app, then when the app is running inside the Player, it will tell you the version of the ArcGIS Runtime that is installed on the Player.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the AppStudio Player version, you can check it by calling &lt;A href="https://doc.arcgis.com/en/appstudio/api/reference/framework/qml-arcgis-appframework-appframework/#version-prop"&gt;AppFramework.version&lt;/A&gt; on the app, that would tell the version of the AppStudio AppFramework that is installed inside the Player, which would correspond to the Player version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erwin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2020 00:44:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/how-can-app-an-detect-if-it-is-running-inside/m-p/774090#M582</guid>
      <dc:creator>ErwinSoekianto</dc:creator>
      <dc:date>2020-01-29T00:44:43Z</dc:date>
    </item>
  </channel>
</rss>

