ChildBrowser plug in, how to use it?

46 posts, 0 answers
  1. Jan-Dirk
    Jan-Dirk avatar
    327 posts
    Member since:
    Jun 2012

    Posted 22 Oct 2012 Link to this post

    I have tried to use the child browser plugin, but it seems not to work.

    I found a couple of examples on the internet that I tried, to no avail. One of them was:

    function openUrl(url) {
           window.plugins.childBrowser.showWebPage(url);
    }

    It seem that my app stopped after reaching the 2nd line.

    Looking forward to some guidelines.
  2. Martin
    Martin avatar
    3 posts
    Member since:
    Oct 2012

    Posted 24 Oct 2012 Link to this post

    Yeah, same issue here.
    window.plugins is undefined :(
  3. Jan-Dirk
    Jan-Dirk avatar
    327 posts
    Member since:
    Jun 2012

    Posted 24 Oct 2012 Link to this post

    Glad to hear that I am not the only one not getting it to work.

    Also not sure how to reference the plug in. I tried like this:
    <script type="text/javascript" charset="utf-8" src="Plugins/Child Browser/childBrowser.js"></script>
  4. Evgeni "Zammy" Petrov
    Admin
    Evgeni "Zammy" Petrov avatar
    168 posts

    Posted 24 Oct 2012 Link to this post

    Hi, JD

     Here is documentation how to add plugins http://docs.icenium.com/icenium-mobile-app-development/working-with-frameworks/apache-cordova/apache-cordova-plugins

    Here is documentation for the plugin we have : https://github.com/alunny/ChildBrowser/blob/3.0.4/README.md 


    @Martin: Do not forget that iOS paths are case sensitive. The right include is

    <script src="Plugins/Child Browser/childbrowser.js"></script>
    @JD: I could not see where you include childbrowser.js file. Without it, it will not work.

    Shout if you have any other issues.

    Regards,
    Evgeni "Zammy" Petrov
    the Telerik team

    Share feedback and vote for features on our Feedback Portal.
    Want some Kendo UI online training - head over to Pluralsight.
  5. Martin
    Martin avatar
    3 posts
    Member since:
    Oct 2012

    Posted 24 Oct 2012 Link to this post

    @Evgeni Thanks - the problem is not related to proper paths.

    I am including it like this:
    <script src="cordova.js"></script>
    <script charset="utf-8" src="plugins/Child Browser/childbrowser.js"></script>

    function onDeviceReady() { window.plugins.childBrowser.showWebPage("http://www.google.com"); } When run in the simulator (iOS and Android) it gives me this on the console: Uncaught TypeError: Cannot read property 'childBrowser' of undefined
    on the above-mentioned call. How to fix that?

  6. Evgeni "Zammy" Petrov
    Admin
    Evgeni "Zammy" Petrov avatar
    168 posts

    Posted 24 Oct 2012 Link to this post

    Hello,

     As I mentioned iOS is case sensitive. The path that you posted is slightly incorrect - it should be "Plugins/Child Browser/childbrowser.js".

     Unfortunately, plugins are currently not supported in Simulator - you can only work with them on a real device. We'll be working on improving this experience in the future. 

     If you have any other problems or suggestion, don't hesitate to write us back.

    Kind regards,
    Evgeni "Zammy" Petrov
    the Telerik team

    Share feedback and vote for features on our Feedback Portal.
    Want some Kendo UI online training - head over to Pluralsight.
  7. Martin
    Martin avatar
    3 posts
    Member since:
    Oct 2012

    Posted 24 Oct 2012 Link to this post

    Oh thanks for pointing that out!
    I was close to getting mad about this ;-)
  8. Jan-Dirk
    Jan-Dirk avatar
    327 posts
    Member since:
    Jun 2012

    Posted 24 Oct 2012 Link to this post

    @Evgeni: I removed the reference to the JS file, that is probably why you didn't find it.

    In general it is good to know what the limits of the simulator are. I should have realized to try on a real device. A call to a plug-in function also breaks any code that comes after the call to that plug-in function.
  9. BLE
    BLE avatar
    46 posts
    Member since:
    Sep 2012

    Posted 03 Jan 2013 Link to this post

    Seriously, a space in the path name?

    Here's what you'll see in the simulator console:
    Error: Failed to load resource -- http://local/Plugins/Child%20Browser/childbrowser.js

    FYI: window.plugins.childBrowser is undefined if you call it before Cordova is initialized.  Also, here's a sample project that might help others out there: https://github.com/Icenium/sample-childbrowser
  10. Arowana
    Arowana avatar
    1 posts
    Member since:
    Feb 2013

    Posted 24 Apr 2013 Link to this post

    This demo is also not working for me .. I am getting issue as "Uncaught TypeError: Cannot read property 'childBrowser' of undefined "

    Please advice me ...
  11. Jan-Dirk
    Jan-Dirk avatar
    327 posts
    Member since:
    Jun 2012

    Posted 24 Apr 2013 Link to this post

    Did you see the post where they say that it doens't work in the simulator? Did you try it on device?
  12. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 24 Apr 2013 Link to this post

    Hello Arowana,

    The sample childbrowser demo is fully runnable as is and you can compare it with your project for differences. Make sure you have added reference to Cordova js file prior the reference to the childbrowser plug-in i.e.:

    <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
    <script type="text/javascript" charset="utf-8" src="Plugins/Child Browser/childbrowser.js"></script>

    Nevertheless our recommendation is to use the new InAppBrowser that is available out-of-the-box with latest Icenium release when choosing Cordova 2.4.

    Useful Links:
    Cordova InAppBrowser Documentation
    Icenium sample app for InAppBrowser

    Regards,
    Steve
    the Telerik team

    Share feedback and vote for features on our Feedback Portal.
    Want some Kendo UI online training - head over to Kendo UI Dojo.
  13. BLE
    BLE avatar
    46 posts
    Member since:
    Sep 2012

    Posted 24 Apr 2013 Link to this post

    Shiny new!  I hadn't seen InAppBrowser before, thanks for the tip.

    P.S. My latest Icenium Graphite throws this error when clicking on the "Clone > Sample Projects" menu option: "The sample projects cannot be loaded.  Please make sure that you are connected to the Internet."  This is obviously a false positive since Graphite won't even load without being connected to the Internet and you can manually paste https://github.com/Icenium/sample-in-app-browser.git into the "Repository Uri" and click "Ok" and the project loads fine.

    Screenshot: https://www.box.com/s/uvvqy6chuxf0uedgsdjx
  14. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 25 Apr 2013 Link to this post

    Hello BLE,

    Thanks for the heads up, we noticed this problem as well and narrow it down to changes in the github API. You can use Mist for the time being where listing the samples still works.

    Greetings,
    Steve
    the Telerik team

    Share feedback and vote for features on our Feedback Portal.
    Want some Kendo UI online training - head over to Kendo UI Dojo.
  15. Bil
    Bil avatar
    1 posts
    Member since:
    May 2013

    Posted 03 May 2013 Link to this post

    In your ChildBrowser plugin is this the correct usage for getting an external link to work;
    I see you are calling the functions for each button from main.js but nothing happens when I click each button.
    I moved the main.js contents under a <script> tag in the index.html to test it in Xcode...and neither work.
    I am attempting to test this using your sample-in-app-browser download from GitHub.

    Can you explain what I am doing wrong?
  16. Kristian D. Dimitrov
    Admin
    Kristian D. Dimitrov avatar
    68 posts

    Posted 07 May 2013 Link to this post

    Hi Bil,

     We tested both samples and when deployed using Icenium everything works as expected. Could you please share more information about the devices you test on and create a jsbin with the code that causes your issue, if its different from the one used in our samples. Do you use Icenium to build and deploy the project or Xcode?

    Regards,
    Kristian D. Dimitrov
    the Telerik team

    Share feedback and vote for features on our Feedback Portal.
    Want some Kendo UI online training - head over to Kendo UI Dojo.
  17. FitFan (Legacy Drophit Account)
    FitFan (Legacy Drophit Account) avatar
    7 posts
    Member since:
    Dec 2012

    Posted 13 May 2013 Link to this post

    <script type="text/javascript" charset="utf-8" src="Plugins/Child Browser/childbrowser.js"></script>

    Does not work since 1.5 - check your own samples - not working
  18. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 14 May 2013 Link to this post

    Hello Zachary,

    We've tested both in the Icenium simulator and on actual device and the sample-in-app-browser demo is working as expected. You can find a video of our observations here. As explained before, the sample-childbrowser demo would not work in the simulator and you need to run it on actual device. If it fails on real device, please share more information about the devices you test on.

    All the best,
    Steve
    the Telerik team

    Don't miss the Icenium May Release Keynote - sign up now!
    Share feedback and vote for features on our Feedback Portal.
  19. FitFan (Legacy Drophit Account)
    FitFan (Legacy Drophit Account) avatar
    7 posts
    Member since:
    Dec 2012

    Posted 14 May 2013 Link to this post

    Not failing on real device, the Graphite editor is showing this an error line and on hover replying:

    HTML: There is no project item on that location.

    This was not the case prior to the upgrade.

    Also I thought I read somewhere that the browser now works in simulator? Your inAppBrowser example does not?
  20. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 14 May 2013 Link to this post

    Hi Zachary,

    Thanks for the clarification - you can safely ignore that error, we would fix it for the next version of Icenium. Even though it is marked as invalid path, if you build and deploy the childbrowser sample on a real device, it would work as expected.

    With the update to Cordova 2.4, you are now able to use the InAppBrowser. I've posted this info in previous post in this thread.

    Kind regards,
    Steve
    the Telerik team

    Don't miss the Icenium May Release Keynote - sign up now!
    Share feedback and vote for features on our Feedback Portal.
  21. FitFan (Legacy Drophit Account)
    FitFan (Legacy Drophit Account) avatar
    7 posts
    Member since:
    Dec 2012

    Posted 14 May 2013 Link to this post

    Gotcha thanks for the help, does the new InAppBrowser work in the simulator? Also, is there anything for facebook login yet using the new InAppBrowser?
  22. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 15 May 2013 Link to this post

    Hi Zachary,

    Yes, the observations posted before are recorded while using the sample-in-app-browser demo in the Graphite simulator.

    Kind regards,
    Steve
    the Telerik team

    Don't miss the Icenium May Release Keynote - sign up now!
    Share feedback and vote for features on our Feedback Portal.
  23. Tom
    Tom avatar
    16 posts
    Member since:
    Jan 2013

    Posted 27 May 2013 Link to this post

    Love Icenium.  ChildBrowser examples really annoying.  If they only work on the device, would you please add a comment in Red on all of the Samples saying so.  We should not have to think about what is going wrong in the simulator.  One would expect that they would work in the simulator.

    The two that I tried are:
    https://github.com/Icenium/sample-childbrowser.git
    https://github.com/Icenium/sample-facebook-api.git
  24. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 27 May 2013 Link to this post

    Hello Tom,

    Thank you for the feedback, we would consider applying some kind of warning/awareness as you suggest.

    Regards,
    Steve
    Telerik

    Don't miss the Icenium May Release Keynote - sign up now!
    Share feedback and vote for features on our Feedback Portal.
  25. Relez
    Relez avatar
    45 posts
    Member since:
    Jan 2013

    Posted 06 Jun 2013 Link to this post

    Hello, I would like to know if there any way I can customize the LocationBar of the ChildBrowserPlugin, for example, hide the URL and add a button with a functionality: "close the childbrowser", for example.

    Thanks!
  26. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 06 Jun 2013 Link to this post

    Hello Relvis,

    Currently there isn't a way as the built-in Icenium Cordova plug-ins are native (i.e. Objective C or Java code) and are compiled on our cloud service that you don't have access to. We're however working on support for custom pluginstall-compatible Cordova plug-ins for the next update of Icenium at the end of June. Then you would be able to add the ChildBrowser plug-in as custom plug-in and customize it as you find fit.

    On a side note, you might take a look at the built-in Cordova InAppBrowser, which might be a better fit for your application.

    Regards,
    Steve
    Telerik

    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
  27. Relez
    Relez avatar
    45 posts
    Member since:
    Jan 2013

    Posted 07 Jun 2013 Link to this post

    I tested the InAppBrowser feature and it looks great, but, may I hide the URL? Keep the DONE button, but hide just the URL?

    Thanks!
  28. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 11 Jun 2013 Link to this post

    Hello Relez,

    Yes you can hide the URL by specifying the location option as third argument of the open method e.g.:

    window.open("http://icenium.com", "_blank",'location=no');

    Regards,
    Steve
    Telerik

    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Missed our first webinar, watch it here.
    Share feedback and vote for features on our Feedback Portal.
  29. Relez
    Relez avatar
    45 posts
    Member since:
    Jan 2013

    Posted 12 Jun 2013 Link to this post

    Hello there, thanks for the reply, in your case I hide the bar, but I would like to show the LocationBar with the Done button, for close the window and return to the application. I just want to hide the URL, not the bar.

    Thanks!
  30. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 12 Jun 2013 Link to this post

    Hello Relez,

    That is exactly what is happening when you use that code, only the url bar is removed, the bar with the Done button is still present and allows you to return.

    Regards,
    Steve
    Telerik

    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Missed our first webinar, watch it here.
    Share feedback and vote for features on our Feedback Portal.
Back to Top