<?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: AppFramework.Network object doesn't work as expected after AppStudio 5 upgrade in ArcGIS AppStudio Questions</title>
    <link>https://community.esri.com/t5/arcgis-appstudio-questions/appframework-network-object-doesn-t-work-as/m-p/1160967#M4236</link>
    <description>&lt;P&gt;Great, the sample app helps!&lt;/P&gt;</description>
    <pubDate>Mon, 04 Apr 2022 21:11:07 GMT</pubDate>
    <dc:creator>KevinCheriyan</dc:creator>
    <dc:date>2022-04-04T21:11:07Z</dc:date>
    <item>
      <title>AppFramework.Network object doesn't work as expected after AppStudio 5 upgrade</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/appframework-network-object-doesn-t-work-as/m-p/1160320#M4232</link>
      <description>&lt;P&gt;We have code in our AppStudio 5 app that checks to see if the device changes network status. If the device goes offline, remove online layers and if it comes back online, add the online-only layers to the map. We use &lt;A href="https://developers.arcgis.com/appstudio/api-reference/qml-arcgis-appframework-network" target="_self"&gt;AppFramework.network&lt;/A&gt; Object to check for triggers of the onlineStateChanged signal. This worked perfectly in AppStudio 4.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const networkChangedStatus = () =&amp;gt; {
      if (!Networking.isOnline) {
            console.log("Status changed", Networking.isOnline)
            removeOnlineLineLayers()
            } else {
               console.log("Status changed", Networking.isOnline)
               addOnlineLayersToMap()
            }
      }
            
AppFramework.network.onlineStateChanged.disconnect(networkChangedStatus)
AppFramework.network.onlineStateChanged.connect(networkChangedStatus)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, in AppStudio 5, this signal doesn't get triggered anymore. I know the &lt;A href="https://developers.arcgis.com/appstudio/api-reference/qml-arcgis-appframework-network#isOnline-prop" target="_self"&gt;isOnline&lt;/A&gt; property in Network is deprecated, so we're using Networking.isOnline, but surely the whole Network library isn't deprecated?&lt;/P&gt;&lt;P&gt;I also checked the Networking object's networkChanged signal and implement that to the above code into lines 11 and 12, like below.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Networking.networkChanged.disconnect(networkChangedStatus)
Networking.networkChanged.connect(networkChangedStatus)&lt;/LI-CODE&gt;&lt;P&gt;But this networkChanged signal gets triggered too often; sitting idle while being connected to network triggers the signal every 10 seconds or so.&lt;/P&gt;&lt;P&gt;What's the best solution here? I want to be able to check the device's network status and make changes accordingly in my map. It seems to me like AppStudio 5 took away the ability to do this.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help appreciated! Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2022 16:16:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/appframework-network-object-doesn-t-work-as/m-p/1160320#M4232</guid>
      <dc:creator>KevinCheriyan</dc:creator>
      <dc:date>2022-04-01T16:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: AppFramework.Network object doesn't work as expected after AppStudio 5 upgrade</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/appframework-network-object-doesn-t-work-as/m-p/1160431#M4234</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/148230" target="_blank"&gt;@KevinCheriyan&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;We actually have a simple sample app, Network Check, that demonstrates how to do this. Have it run and disconnect/reconnect to a network to see how it updates automatically. Essentially, the app determines the device isOnline by using a NetworkConfiguration component, a component that encapsulates a single access point or service network, to see if the device is connected to wifi, lan, or mobile data. In the sample, you can create a signal handler isOnlineChanged: {} to do stuff if isOnline property changes.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/appstudio/api-reference/qml-arcgis-appframework-networking-networkconfiguration" target="_self" rel="nofollow noopener noreferrer"&gt;See this doc for more details&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Trevor Frame&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2022 20:26:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/appframework-network-object-doesn-t-work-as/m-p/1160431#M4234</guid>
      <dc:creator>TrevorFrame</dc:creator>
      <dc:date>2022-04-01T20:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: AppFramework.Network object doesn't work as expected after AppStudio 5 upgrade</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/appframework-network-object-doesn-t-work-as/m-p/1160967#M4236</link>
      <description>&lt;P&gt;Great, the sample app helps!&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 21:11:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/appframework-network-object-doesn-t-work-as/m-p/1160967#M4236</guid>
      <dc:creator>KevinCheriyan</dc:creator>
      <dc:date>2022-04-04T21:11:07Z</dc:date>
    </item>
  </channel>
</rss>

