Excessive use of HTTP warning from Google Play

Occasionally I get this warning on a pre-launch report for some of my apps.

I don’t always get the warning, and usually if I upload a new build of the app the pre-launch report doesn’t contain the same warning. But I’d like to know why it sometimes happens and if it does indicate there is a actual problem.

I don’t issue any WWW or UnityWebRequest calls in any of my own code, but I use Google Play Game Services and that does use UnityWebRequest, however from what I can ascertain, it uses https for the URLs it queries.

I also call Unity.Services.RemoteConfig.Utilities.CheckForInternetConnection(), which I guess could be using HTTP under the hood, but I can’t find out one way or the other.

There are very few hits for ‘Excessive use of HTTP warning from Google Play’ on Google, so I didn’t find any help there either.

Has anyone on here encountered and resolved the same issue?

Thanks

I’ve just received the warning on the latest version I’ve uploaded. The previous 3 uploads didn’t flag the issue, and there was nothing changed in any of these updates that related to HTPP.

So, at the moment, I can’t even be sure that any changes I make might actually fix the issue.

I’m not sure how to implement this advice from google

Would someone be able to give me some pointers on what I need to do to track down the source of the HTTP requests?

Thanks

So given the lack of help from any of the places I’ve asked about this, I’ve had to try an eliminate the only possible source for the HTTP requests that I can think of, which is the Unity.Services.RemoteConfig.Utilities.CheckForInternetConnection() call, to which end I have written my own internet checker class.

using System.Collections;
using UnityEngine;
using UnityEngine.Networking;

public class ConnectionChecker
{
    public class ReachabilityResult
    {
        public bool IsReachable;
    }

    // This is the function that waits until the internet is reachable
    public static IEnumerator WaitUntilInternetIsReachable()
    {
        yield return WaitUntilInternetIsReachable(5f);
    }

    public static IEnumerator WaitUntilInternetIsReachable(float checkFrequency)
    {
        var waitTime = new WaitForSeconds(checkFrequency);
        ReachabilityResult result = new ReachabilityResult();
        do
        {
            yield return CheckInternetReachable(result);

            if (!result.IsReachable)
            {
                // Wait for a few seconds before trying again
                yield return waitTime;
            }

        } while (!result.IsReachable);

        Debug.Log("DBug: Internet is now reachable.");
    }

    public static IEnumerator CheckInternetReachable(ReachabilityResult result)
    {
        var internetIsReachable = Application.internetReachability;

        Debug.Log($"DBug: Start internet Check. {internetIsReachable}");
        if (internetIsReachable == NetworkReachability.NotReachable)
        {
            result.IsReachable = false;
        }
        else if (internetIsReachable == NetworkReachability.ReachableViaCarrierDataNetwork)
        {
            result.IsReachable = true;
        }
        else // ReachableViaLocalAreaNetwork, so check it is actually reachable
        {
            var url = "https://www.google.com";
            using (UnityWebRequest webRequest = UnityWebRequest.Head(url))
            {
                // Send the web request and wait for it to complete
                yield return webRequest.SendWebRequest();

                // Determine if the URL is reachable based on the returned result
                result.IsReachable = webRequest.result == UnityWebRequest.Result.Success;
            }
        }
    }
}

As far as I can tell, this should be fairly efficient and not produce any plain HTTP requests. So all I can do now is implement this in my apps and see if the random warnings for HTTP calls stop appearing.