Firebase working on local network? What's going on?

Viewed 67

I had a rather odd experience today. I was able to connect to firebase and send messages, while not having an internet connection, but local wifi connection only. I use a snippet of code in my application to determine if I'm "online" or not, not just connected to a network. See below:

    public boolean amIOnline(){
    statusCode = -1;

    try{
        url = new URL("https://www.google.com");
        http = (HttpURLConnection) url.openConnection();
        statusCode = http.getResponseCode();
        http.disconnect();
    }
    // Either no legal protocol could be found in a specification string or the string couldn't be parsed
    catch (MalformedURLException m){
        SingletonInternetConnectivity.connectedToInternet = false;
        return false;
    }
    // An I/O exception of some sort has occurred
    catch (IOException io){
        SingletonInternetConnectivity.connectedToInternet = false;
        return false;
    }

    // Internet Connected
    if(statusCode == HttpURLConnection.HTTP_OK){
        SingletonInternetConnectivity.connectedToInternet = true;
        return true;
    }
    // Internet Disconnected
    else{
        SingletonInternetConnectivity.connectedToInternet = false;
        return false;
    }
}

When connecting to a school's network for a presentation, I tried to use google chrome to look up, well, "red foxes", which is my safe lookup search lol. Google chrome results didn't show, and I was told I had no internet connection. When I opened my WiFi settings, it said "Connected, no Internet." My application, via the snippet of code, also said I was not connected. However, when using my application, my firebase messages transmitted just fine. Why is this? I also noticed that my Google apps were updating in the background, such as the Google Play Music, Maps, etc.

I've noticed this before as well, apps updating with no connection at all - not even trying to connect. It feels like Google apps can update as long as any network is in range, even while not entering a password and connecting.

Any ideas on this? Can you sent firebase messages on a local network? Or is something fancy going on here?

Thanks in advance!

0 Answers
Related