private boolean hasInternetConnection() {
        int permissionCheck = mAppContext.getPackageManager().checkPermission(Manifest.permission.ACCESS_NETWORK_STATE,
                mAppContext.getPackageName());

        if (permissionCheck != PackageManager.PERMISSION_GRANTED) return true;

        ConnectivityManager cm = (ConnectivityManager) mAppContext.getSystemService(Context.CONNECTIVITY_SERVICE);

        NetworkInfo wifiNetwork = cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
        if (wifiNetwork != null && wifiNetwork.isConnected()) return true;

        NetworkInfo mobileNetwork = cm.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
        if (mobileNetwork != null && mobileNetwork.isConnected()) return true;

        NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
        return activeNetwork != null && activeNetwork.isConnected();
    }