Acknowledged

makeWebRequest returns error -202 on iOS 16 device

I am using makeWebRequest with method Communications.HTTP_REQUEST_METHOD_GET and Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON to query a REST API.

A user reported that when using an iPhone X with iOS 16, they get a -202 error, INVALID_HTTP_METHOD_IN_REQUEST. The same user tried with the same watch but an iOS 18 device, and the error does not occur. They are using an Epix Pro Gen 2 51mm with latest software version 18.14 and the Connect app is also latest version 5.5.0.23. Together with the user we tried different endpoints for the request, one https, one http, both result in the same error when the iOS 16 device is used.

My personal setup is similar, same watch, same software versions and for me it works as well.

My app uses the latest SDK 7.3.0. My VS Code version is 1.92.2 with Monkey C extension 1.0.11.

    function makeRequest() as Void {
       
        var url = _siteConfig.getUrl() + "/api/state";
        
        var options = {
            :method => Communications.HTTP_REQUEST_METHOD_GET,
            :responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON
        };

        Communications.makeWebRequest( url, null, options, method(:onReceive) );
    }

I already tried removing the :method part of the options and had the affected user test it, but the issue persists.

Unfortunately I do not have any other iOS 16 device to test, so I cannot be certain if it is really an issue with iOS 16 in general, or something more particular to the user's device. In any case, I believe this to be a device-specific bug, since the code follows the SDK documentation and works on other devices.

  • OK, now found the root cause of the issue. I am using a long query string in the URL, and it seems under iOS 16 this is causing the -202 error. When removing the query string it works there. Doing that may be a workaround but only for devices with sufficient memory for the app. If the query string is removed, the response of the server becomes very large, resulting in issues on older devices, especially in the glance there (that's why I introduced this query string in the first place).

    Can‘t judge if this issue is inherent to iOS 16, or a result of how the Garmin app makes its request.