Custom Top Bar

Welcome! Forums Unity Plugins In-App Web Browser Custom Top Bar

Tagged: 

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #339
    chisomo
    Participant

    I have an app that looks like a native app with a specific design, each page has a header but when I open a web page it break the illusion because suddenly the header is different. The previous page looked like this:

    Header design

    So how can I design the web browser header in unity to look like this:

    design 2

    Or at the very least if I design the web page like that and hide the web browser header then what code should I use in html / php to lose the browser and go back to unity because in the documentation there is c# code to close the browser but only after a set time and Iphone doesn’t have a back button so I need some sort of Header back button… but not the default one

    • This topic was modified 3 years, 7 months ago by PiotrPiotr.
    #340
    PiotrPiotr
    Keymaster

    Use C# – JS communication in order to close the browser.

    #345
    chisomo
    Participant

    Any advice on how to do that?

    #346
    chisomo
    Participant

    As in where do I put this code? in the c# in unity or the php on my server? and do you have code snippets I an look at on this?

    #347
    PiotrPiotr
    Keymaster

    Example is in readme file.

    #348
    chisomo
    Participant

    The example I saw in there closed after a few seconds, I want the reader to exit the browser after tapping the back button in the header.

    #349
    PiotrPiotr
    Keymaster

    I mean example of JS<->C# communication. There’s even sample scene for it.

    #357
    chisomo
    Participant

    Hello, I see the js communication and I think I have gotten a grasp on the unity side of it, having it listen for the call and what to do when certain messages are received but I do not understand how to send the js message from the web site side, is code for the page that opens in the sample scene available

    #358
    chisomo
    Participant

    I inspected the page in chrome and saw the onclick=”sendPing()” function on the button but I don’t know how to define this function

    #359
    chisomo
    Participant

    I figured it out, thank you for the awesome asset

    #363
    PiotrPiotr
    Keymaster

    🙂

    #741
    rulewan
    Participant

    Hi Piotr,
    I have created my own top and bottom bars due to handle close, navigate back and navigate forward functionalities. Both bars are working properly in terms of functionality, but only when I use text for the buttons. My problem is when I try to use background images for that buttons due to find the path for loading those images.
    So my question is, is it possible to load the images for the buttons’ backgrounds from any device folder?
    Right now, I have the images stored into Persistent Data Folder but cannot get them when executing javascript code:
    buttonExit.style.backgroundImage = ‘url(‘Cross.png’)’;
    It works fine when I have the image in the same folder as the html code, but using your plugin I really don’t know how to load the image cause I’m not sure about the path to use.
    Regards,

    #770
    PiotrPiotr
    Keymaster

    @rulewan, that might be tricky. Can you try using base64 instead?

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