QML Has Internet Connection

894
4
03-20-2019 08:54 AM
MKa
by
Occasional Contributor III

I am trying to determine if my app has an internet connection?  It seems like Networking.isOnline is always returning true even though i have airplane mode on on my computer or phone.  I have a mode that I allow a user to take the data offline when they know they won't have internet or cell service.  

I don't want the app to be able to then come back ONLINE when there is no Network Connection or internet when coming back online

console.log("------- Networking.isOnline: ", Networking.isOnline)

When my app comes back from an offline mode, it has to have internet connection to sync all the data

But is seems like Networking.isOnline is always true?
0 Kudos
4 Replies
LucasDanzinger
Esri Frequent Contributor

Hi, I think it might be good to check with AppStudio team since you are using the AppFramework Networking module. AppStudio for ArcGIS‌ any ideas? Stating the platforms you are seeing this on would be helpful I'm sure.

0 Kudos
AnshumanMathur2
Occasional Contributor

Hi,

 

Can you help to provide a few more details that might help in troubleshooting the issue.

 

  1. What version of AppStudio are you using to create your app?
  2. What is the operating system of your computer and which mobile device are you using to test your app?
  3. Also, it might be helpful to see if the issue is reproducible when we run the app in AppStudio Player. Can you try to run your app in the latest version of AppStudio Player. You can install it on Android from https://play.google.com/store/apps/details?id=com.esri.appstudio.player and iOS from https://itunes.apple.com/us/app/appstudio-player-for-arcgis/id1018006050.

 

Thanks,

Anshuman

0 Kudos
MKa
by
Occasional Contributor III

1. My version of App Studio is 3.2.79.

2. Testing on Windows 10 and IOS 12.1.4

3. My App Studio Player is 3.2.35

It fails to show offline in windows when I first go offline on my app (so my app doesn't require network), but Networking.isOnline is still true because it still has a connection.  Then i kill the network with either ipconfig /release of disconnection modem (not router).  I need to detect that I have not internet access rather quickly, as in both of these instances Networking.isOnline is still true.  So then my app thinks it can go back online and this causes numerous issues with the app.  I need some type of quick Network tester on top of Networking.isOnline.  Any ideas?

0 Kudos
StephenQuan1
Esri Contributor

Dear M Ka,

As this is an AppStudio question, it's probably asked in the AppStudio community: https://community.esri.com/groups/appstudio

Sometime ago, I wrote a blog on LAN, WIFI, Mobile Network Check. See the blog here: https://community.esri.com/groups/appstudio/blog/2018/06/19/network-check

Stephen

0 Kudos