# Checking internet connection before load firebase

**URL:** <https://forum.ionicframework.com/t/checking-internet-connection-before-load-firebase/115273>\
**Category:** ionic-v1\
**Created:** [December 13, 2017, 1:21pm UTC](https://forum.ionicframework.com/t/checking-internet-connection-before-load-firebase/115273 "2017-12-13T13:21:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nachonrb](https://avatars.discourse-cdn.com/v4/letter/n/ba9def/32.png) [@nachonrb](https://forum.ionicframework.com/u/nachonrb)\
**Post date:** [December 13, 2017, 1:21pm UTC](https://forum.ionicframework.com/t/checking-internet-connection-before-load-firebase/115273/1 "2017-12-13T13:21:36Z")

</div>

Hello!  
I’m developing an app with Ionic1, AngularJS and Firebase as backend.  
I have to check if the phone has internet connection before load all the Firebase scripts, if not, the app doesn’t work.

I thought that checking with this was enough, but I was wrong:

```auto
if(window.Connection) {
      if(navigator.connection.type == Connection.NONE) {
}}

```

I guess that its because Firebase is being imported anyway in the app here:  
`angular.module('starter', ['ionic', 'starter.controllers', 'starter.services' , 'firebase'])`

Is there any way to load ALL the components of Firebase once I am sure that the device has connection?

Thanks very much,  
Regards, Nacho.

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:59pm UTC](https://forum.ionicframework.com/t/checking-internet-connection-before-load-firebase/115273/2 "2021-07-19T21:59:25Z")

</div>

Closed on July 19, 2021, 9:59pm UTC


