iOS issue

Tagged: , ,

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1318
    MeMyself
    Participant

    When I use the plugin, it works the first time on iOs, but after some tries the page stays blank.
    I don’t know if it’s a cache issue or DontDestroyOnLoad…
    Once the page is blank it will do it each time.(no loading animation, no error message in the console)
    It seems to occur only on iOS
    Any help appreciated.

    #1319
    PiotrPiotr
    Keymaster

    Is it happening with every website?

    #1320
    MeMyself
    Participant

    I don’t know. I’m just linking different wikipedia articles “https://wikipedia.org/wiki/Example”

    #1321
    PiotrPiotr
    Keymaster

    Are you getting anything in onBrowserFinishedLoadingWithError callback?

    #1339
    MeMyself
    Participant

    I tried to implement the callback but keep getting “SendMessage: object InAppBrowserBridge not found!”

    #1340
    PiotrPiotr
    Keymaster

    So add it to the scene. Check readme file.

    #1341
    MeMyself
    Participant

    Ok. I had it added into the scene but it was manually without using the prefab. Now with the prefab I have the callbacks.
    Here is the result I have :
    url : (null)
    Error : Error Domain=WebKitErrorDomain Code=101 “(null)”

    I check before calling InAppBrowser.OpenURL() that the url string sent is not null and valid . I’m sure the problem is not with the url because I can have the same url loaded without problem and then having trouble with it another time.

    Regards

    #1347
    MeMyself
    Participant

    Hi Piotr,
    Do you have any clue ?
    I have a Scene with 3 UI pages in a Canvas (menu, levelselect and game)
    It seems to occur when I change the UI to menu and then return to the game. The strange thing is there is no problem on Android.

    #1348
    PiotrPiotr
    Keymaster

    Hi,
    Android and iOS use completely different engines so it’s perfectly normal to see such differences.

    I see a lot of questions regarding this on StackOverflow like here:
    https://stackoverflow.com/questions/2028379/uiwebkit-error-101

    Try to examine those links, maybe there’s space and the end of beginning.

    #1349
    MeMyself
    Participant

    OK I found it.
    it seems there is a bug (don’t know where it come from). Sometimes the url string gets a linebreak at the end (I’m sure it doesn’t come from my url because I have the same test string variable sometimes working, sometimes not). So this line in AppBrowserViewController.mm startLoadingWebView was returning null
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:_URL]];

    So here’s what I did

    (void)startLoadingWebView {
        _webView.delegate = self;
        if (_HTML) {
            [_webView loadHTMLString:_HTML baseURL:nil];
        } else {
            NSString *webStringURL = _URL;
            NSArray *split = [webStringURL componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]];
            split = [split filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"length > 0"]];
            webStringURL = [split componentsJoinedByString:@""];
            NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:webStringURL]];
            [_webView loadRequest: request];
        }

    There must be a cleaner way, but it works.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.