2032 StreamError from URLRequest on older devices

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

2032 StreamError from URLRequest on older devices

Erik J. Thomas
Hey all:

Tried testing my Flex app on iPhone 4S and iPad 2 and URLRequests are failing on both of them, though they work perfectly on iPhone 5, 6, and iPad AIR 2.

The error is a 2032 StreamError.

App descriptor supports v9:

<key>MinimumOSVersion</key>
    <string>9.0</string>

Both the iPhone 4S and iPad 2 are running v9.3.5 (last supported version for these older devices).
Captured AIR (v23)
Flex SDK v4.15

It seems really strange that this code would only work on iPhone 5 and later devices...

var address:String = _controller.baseUrl + "/auth";
var urlRequest:URLRequest = new URLRequest(address);
urlRequest.method = URLRequestMethod.POST;
               
urlRequest.idleTimeout = 16000;
URLRequestDefaults.idleTimeout = 16000;
               
var header:URLRequestHeader = new URLRequestHeader("email", username.text);
urlRequest.requestHeaders.push(header);
header = new URLRequestHeader("password", password.text);
urlRequest.requestHeaders.push(header);
header = new URLRequestHeader("eventId", _controller.brandedProperties.eventId);
urlRequest.requestHeaders.push(header)

var urlLoader:URLLoader = new URLLoader();
urlLoader.addEventListener(Event.COMPLETE, loginSucceeded);
urlLoader.addEventListener(IOErrorEvent.IO_ERROR, loginFailed);
urlLoader.load(urlRequest);

Thought it could be timeout issue on slow devices so I set the idleTimeout values to be sure. Makes no difference.

Searched the web, found some references to 2032, but not this issue.

Any ideas greatly appreciated.

Erik

Reply | Threaded
Open this post in threaded view
|

Re: 2032 StreamError from URLRequest on older devices

clintm
Add this to your descriptor file to talk to http…

<InfoAdditions>
    <![CDATA[
    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSExceptionDomains</key>
        <dict>
            <key>yourapiurl.com</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSExceptionAllowsInsecureHTTPLoads</key>
                <true/>
            </dict>
        </dict>
    </dict>
    ]]>
</InfoAdditions>


On Thu, May 11, 2017 at 11:59 AM, Erik J. Thomas <[hidden email]> wrote:

> Hey all:
>
> Tried testing my Flex app on iPhone 4S and iPad 2 and URLRequests are
> failing on both of them, though they work perfectly on iPhone 5, 6, and
> iPad AIR 2.
>
> The error is a 2032 StreamError.
>
> App descriptor supports v9:
>
> <key>MinimumOSVersion</key>
>     <string>9.0</string>
>
> Both the iPhone 4S and iPad 2 are running v9.3.5 (last supported version
> for these older devices).
> Captured AIR (v23)
> Flex SDK v4.15
>
> It seems really strange that this code would only work on iPhone 5 and
> later devices...
>
> var address:String = _controller.baseUrl + "/auth";
> var urlRequest:URLRequest = new URLRequest(address);
> urlRequest.method = URLRequestMethod.POST;
>
> urlRequest.idleTimeout = 16000;
> URLRequestDefaults.idleTimeout = 16000;
>
> var header:URLRequestHeader = new URLRequestHeader("email", username.text);
> urlRequest.requestHeaders.push(header);
> header = new URLRequestHeader("password", password.text);
> urlRequest.requestHeaders.push(header);
> header = new URLRequestHeader("eventId", _controller.brandedProperties.
> eventId);
> urlRequest.requestHeaders.push(header)
>
> var urlLoader:URLLoader = new URLLoader();
> urlLoader.addEventListener(Event.COMPLETE, loginSucceeded);
> urlLoader.addEventListener(IOErrorEvent.IO_ERROR, loginFailed);
> urlLoader.load(urlRequest);
>
> Thought it could be timeout issue on slow devices so I set the idleTimeout
> values to be sure. Makes no difference.
>
> Searched the web, found some references to 2032, but not this issue.
>
> Any ideas greatly appreciated.
>
> Erik
>
>
Reply | Threaded
Open this post in threaded view
|

Re: 2032 StreamError from URLRequest on older devices

Erik J. Thomas
Thanks, Cliff. Was worth a try but no change. iPhone 5 and 6 works, iPhone 4 fails. We're going to just drop older devices from our supported versions.

Erik

> On May 11, 2017, at 12:59 PM, Clint M <[hidden email]> wrote:
>
> Add this to your descriptor file to talk to http…
>
> <InfoAdditions>
>    <![CDATA[
>    <key>NSAppTransportSecurity</key>
>    <dict>
>        <key>NSExceptionDomains</key>
>        <dict>
>            <key>yourapiurl.com</key>
>            <dict>
>                <key>NSIncludesSubdomains</key>
>                <true/>
>                <key>NSExceptionAllowsInsecureHTTPLoads</key>
>                <true/>
>            </dict>
>        </dict>
>    </dict>
>    ]]>
> </InfoAdditions>
>
>
> On Thu, May 11, 2017 at 11:59 AM, Erik J. Thomas <[hidden email]> wrote:
>
>> Hey all:
>>
>> Tried testing my Flex app on iPhone 4S and iPad 2 and URLRequests are
>> failing on both of them, though they work perfectly on iPhone 5, 6, and
>> iPad AIR 2.
>>
>> The error is a 2032 StreamError.
>>
>> App descriptor supports v9:
>>
>> <key>MinimumOSVersion</key>
>>    <string>9.0</string>
>>
>> Both the iPhone 4S and iPad 2 are running v9.3.5 (last supported version
>> for these older devices).
>> Captured AIR (v23)
>> Flex SDK v4.15
>>
>> It seems really strange that this code would only work on iPhone 5 and
>> later devices...
>>
>> var address:String = _controller.baseUrl + "/auth";
>> var urlRequest:URLRequest = new URLRequest(address);
>> urlRequest.method = URLRequestMethod.POST;
>>
>> urlRequest.idleTimeout = 16000;
>> URLRequestDefaults.idleTimeout = 16000;
>>
>> var header:URLRequestHeader = new URLRequestHeader("email", username.text);
>> urlRequest.requestHeaders.push(header);
>> header = new URLRequestHeader("password", password.text);
>> urlRequest.requestHeaders.push(header);
>> header = new URLRequestHeader("eventId", _controller.brandedProperties.
>> eventId);
>> urlRequest.requestHeaders.push(header)
>>
>> var urlLoader:URLLoader = new URLLoader();
>> urlLoader.addEventListener(Event.COMPLETE, loginSucceeded);
>> urlLoader.addEventListener(IOErrorEvent.IO_ERROR, loginFailed);
>> urlLoader.load(urlRequest);
>>
>> Thought it could be timeout issue on slow devices so I set the idleTimeout
>> values to be sure. Makes no difference.
>>
>> Searched the web, found some references to 2032, but not this issue.
>>
>> Any ideas greatly appreciated.
>>
>> Erik
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: 2032 StreamError from URLRequest on older devices

Nemi
In reply to this post by Erik J. Thomas
Try listen to all events, maybe more info will appear do debug the problem.