Network not working with iphone_new

58 views
Skip to first unread message

Carlos Verdier

unread,
May 26, 2016, 8:11:41 AM5/26/16
to CodenameOne Discussions
Hi

I'm trying the new iOS build and the fist thing I have noticed is that the following method returns false:

    private Boolean detectaInternet() {
        String detectaInternet = NetworkManager.getAutoDetectURL();        
        internet = true;
        ConnectionRequest cr = new ConnectionRequest() {
            @Override
            protected void handleIOException(IOException err) {
                internet = false;
            }            
        };
        cr.setPost(false);        
        cr.setUrl(detectaInternet);
        NetworkManager.getInstance().addToQueueAndWait(cr);
        return internet;
    }


This is not working either:

WebBrowser browser = new WebBrowser();
browser.setURL(url);

Building with iphone, woks fine

Thanks

Carlos Verdier

unread,
May 26, 2016, 3:52:10 PM5/26/16
to CodenameOne Discussions

Carlos Verdier

unread,
May 26, 2016, 4:21:44 PM5/26/16
to CodenameOne Discussions
Reading further about this, now I see Apple might reject my app if I overcome their security restriction. But what if I want to develop a Mag app and one of the most relevant functions is to allow users browse advertisers URLs in an internal browser. I can't possibly know what those URL will be, so it's not possible to add exceptions for them. I have to enable insecure http for that. Do you think this will be a good reason for Apple? 

I hope so...

Shai Almog

unread,
May 27, 2016, 1:13:30 AM5/27/16
to CodenameOne Discussions
Probably not.
I think the limitation only applies to http POST but I'm not sure about that...

Carlos Verdier

unread,
May 27, 2016, 5:40:13 AM5/27/16
to CodenameOne Discussions
I found this post, which answer all posible situations, including the one I was asking. Good to know that you can opt out all with exceptions

Reply all
Reply to author
Forward
0 new messages