Viewing 10 replies - 1 through 10 (of 10 total)
  • Same issue here. I am using my own mobile theme so I don’t expect it to be like a native app but it simply opens up Safari and loads all pages there on all menu items. So theres is not much app left. In addition it shows 62 warning messages while loading a test app image on my iPhone and doesn’t trigger a push notification message that you normally get before you allow push to receive. Please advise. Thanks.

    Thread Starter Ryanio

    (@ryanio)

    Same here, I have published two apps now and both have had 60+ error warnings and some errors which prevent the app from launching. It took extensive googling to fix the problem seeing as I know nothing about objective-c.

    Plugin Author Dave Anthony

    (@mobilerockstar)

    Hi there,

    They are not errors they are Warnings in Xcode. Although they are thing that are being fixed your app will fully work as they are notes to the developer for future developement.

    As for the opening the in-app browser – this is one of the reasons that using your own theme is not recommended.

    If you use cross-domains or _blank targets it will open in the in-app browser.

    @ryanio, did you find a solution for the menu links opening in Safari? How did you solve this? I still can only make this work with some custom java script on my theme, which causes other issues with lightbox, etc., so that I want to avoid that. This has to work by default with Cordova somehow as I just have standard links and no _blank, etc…

    Thread Starter Ryanio

    (@ryanio)

    @bj123 I still do not have a solution. May I ask, could you post your javascript snippet? I feel like I’ve tried everything and im getting a bit desperate now.

    Dave, I have tried to use _blank targets but still no dice. It seems like no matter what the links open with safari. Do you have any other potential solution I could try?

    Let me first say that I am not a web developer but merely building my own site. I searched on google and found someone else’s java script regarding old fashioned web apps. Thus it is not really made for a phone gap hybrid app like this one here. It seems that this is in Phonegap/Cordova controlled by plugins and by default usually everything stays in the App. Usually people are having a hard time getting _blank links out of the App. That’s why it is quite unusual that it opens everything in Safari. I just copied this into my custom java field of my theme on the dashboard but it has influence on the entire website and photo lightbox, some other pop-out, etc doesn’t work anymore. That’s why I can only use it for basic testing and it does not resolve the problem of making the app work:

    $(‘a’).live(‘click’, function (event)
    {
    var href = $(this).attr(“href”);

    // prevent internal links (href.indexOf…) to open in safari if target
    // is not explicitly set_blank, doesn’t break href=”#” links
    if (href.indexOf(location.hostname) > -1 && href != “#” && $(this).attr(“target”) != “_blank”)
    {
    event.preventDefault();
    window.location = href;
    }

    });

    Thread Starter Ryanio

    (@ryanio)

    @bj123 thank you for that.

    I also agree it is very strange that it is opening in safari every time.

    I am also not a developer but I would imagine you could maybe adjust that a little to work for only the menu by using the .class selector and giving the menu items a class. maybe something similar to below:

    $(‘a’).live(‘click’, function (event)
    {
    var href = $(“.menuClass”).attr(“href”);

    // prevent internal links (href.indexOf…) to open in safari if target
    // is not explicitly set_blank, doesn’t break href=”#” links
    if (href.indexOf(location.hostname) > -1 && href != “#” && $(this).attr(“target”) != “_blank”)
    {
    event.preventDefault();
    window.location = href;
    }

    });

    This does not work for me, but maybe it will help you.

    Plugin Author Dave Anthony

    (@mobilerockstar)

    Hi guys,

    I’m currently working on this. I hope to have a fix in tonight’s release.

    Plugin Author Dave Anthony

    (@mobilerockstar)

    Has the latest update solved your problem?

    For my part I don’t know because I used another solution for my app. Someone else maybe can answer this please.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Menu Items Opening Browser Window’ is closed to new replies.