Anand Rajput
Anand Rajput

Reputation: 479

firebase android app not working with mobile data

My Firebase Android app is not working whenever I connect with mobile data. All features such as auth, database and storage are unreachable. I am currently in India, using an Aircel sim. Is the problem from Firebase server or my network provider.

Error in logcat says:

Network error (such as timeout, interrupted connection or unreachable host) has occurred

Works on wifi though, dunno why

Upvotes: 6

Views: 8066

Answers (7)

MUHOOZI DENIS
MUHOOZI DENIS

Reputation: 61

I added the code below before declaring databaseReference and it worked well

/*Enable offline access to the data from the Cloud and synchronise when the network connection is established again*/
     
FirebaseDatabase.getInstance().setPersistenceEnabled(true);
        

Upvotes: 0

I got same kind of problem, (images are not downloading from Firebase Storage, over mobile data) using from Bangladesh.

So,I mailed it to 'Firebase' & they give me these solution, "Please, try to use a VPN, in similar cases like this it worked and reduced the scope of the issue."

Then, I used VPN with my Mobile data & everything worked fine. :)

Upvotes: 1

Check data restrictions of

Google Services

If you are on restricted data mode of Google services, your application will not work. I solved it by disabling the restriction mode.

Upvotes: 0

Jorge Soasti
Jorge Soasti

Reputation: 1

I solved it by activating the use of google play services mobile data, in configuration, apps, use of mobile data

Upvotes: 0

Isee You
Isee You

Reputation: 75

In case, you are facing such problem you can simply go to mobile network >> access point names >> check GPRS button and try to change the access point names from the drop down list. Switch off your data and then on. You can reboot your phone if there is still any issue.

Upvotes: 0

user2695433
user2695433

Reputation: 2153

Firebase server does not have any restrictions on internet connection. This would be your mobile internet provider's issue. Also, it would be worth checking whether have any settings in mobile device is enabled to restrict mobile data usage for any specific apps like to use Wifi only.

PS: I'm from India, use Airtel and Vodafone mobile data connections often for Firebase based apps when Wifi is not around . But occasionally faced similar issues when don't have sufficient signal range especially changes to 2G.

Upvotes: 1

XY-JOE
XY-JOE

Reputation: 1782

The problem is most likely from your network provider. I think you might have a very bad network or still, check to see if the date and time of the emulator you are using to run your application is correct if not correct it. Firebase is not suppose to give you that kind of error as firebase could also sometimes be accessible even when your device is not connected to the internet.

Upvotes: 0

Related Questions