Ionic first time app is not working without network


#1

I am build my .apk file and run on device without any network it show white screen.
But if i install my apk with network connection and after that it works on without network.
How can it possible without network to install apk and it run successfully.

Thanks in advance.


#2

How are you using navigator.connection.type ? on app run ?


#3

My app is running in offline mode if internet is not available. so when i build my .apk file and install it without any network it shows my white page.

same case when i install it with network first time and after that when app is run successfully then i close my app and stop my wifi and other network connections it working properly.

So my question is how can i install my app without internet.


#4

I had the exact same issue. In my case i was using navigator.connection.type like

.factory('Network', function(){
    var network = navigator.connection.type; // this was causing the same issue
    ....
})

but then i changed to this

.factory('Network', function(){
   var getNetwork = function(){
      return navigator.connection.type; 
   }
    ....
})

and the problem was solved.


#5

I am checking in every controller my network state.
The problem is on first time when i install my .apk without wifi connection its show me white page rather than login page.


#6

How are you checking network state in controller ? Can you provide code ?