You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/01/10 16:31:23 UTC

[GitHub] [cordova-plugin-network-information] rolinger commented on issue #134: What exactly is triggering online/offline events?

rolinger commented on issue #134:
URL: https://github.com/apache/cordova-plugin-network-information/issues/134#issuecomment-1009067562


   @powysm - We changed many things.  In fact we completely rewrote how our app initializes, greatly simplifying it and eliminating almost all outside dependencies during start up.  We use google's places/autocomplete for tying in city/town names - so this loads way before onDeviceReady() fires.  If the google maps api fails to load, the call back is never called, thus something must be wrong with the internet connection.  The onDeviceReady() function then looks to see if the a maps global variable is to true or false (online/offline).  If true, carry on, if false, pop warning message to user and then do a deeper dive into finding out why.  Since we moved to this method we have no more reports of "offline" app hanging on launch:
   
   ```
   <script async defer 
         src="https://maps.googleapis.com/maps/api/js?key=api_key&amp;libraries=places&callback=mapsCallback" type="text/javascript">
   </script>  
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org