Handling file types

Welcome! Forums Unity Plugins In-App Web Browser Handling file types

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #407
    zsculptblack
    Participant

    I’d like to be able to intercept a clicked link and decide what to do with it before letting the web browser load the URL. For example:

    http://www.website.com/textfile.txt

    If it’s any other kind of file besides .html, I’d like to just let my App handle the URL instead of opening it in the web view. Is this possible?

    #409
    PiotrPiotr
    Keymaster

    Hey,

    I was thinking about supporting it, however there’s one problem – communication between native plugin and your C# scripts is asynchronous. Meaning, whenever web browser loads a website it would have to communicate with Unity and wait for an answer. That would slow loading process down.

    There would have to be some way of pre-defined behavior whenever some special URL comes up. Something like:

    1. There’s special URL – close browser
    2. Send an event to C# listener

    Any thoughts?

    #412
    zsculptblack
    Participant

    I’ll have to look how I did it in my old Objective C projects. I think I just looked at the returned URL from a link and if it was anything other than .html, .php, or any other standard web page types, I passed the payload on to the app and let it decide what to do. I wanted to avoid getting back into writing custom plug-ins for Unity, but that’s probably what I’ll end up doing.

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