nategametaco

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: Where is webkit.messageHandlers.UnityInAppBrowser? #11689
    nategametaco
    Participant

    With our last Web View component (that conflicted with the Facebook SDK, so switched to yours) I was able to do this. Can I get access to your code so I can add this functionality? I don’t expect you to add this feature for one person. That and I don’t mind sharing it back to you as a feature to your component. Would this be possible? Thanks! npacyga@gametaco.com

    in reply to: Where is webkit.messageHandlers.UnityInAppBrowser? #11687
    nategametaco
    Participant

    Bump.

    in reply to: Where is webkit.messageHandlers.UnityInAppBrowser? #11679
    nategametaco
    Participant

    Got it working now based off your example. The trick was the “window” object. Be sure to update your documentation. You need the reference to that dynamic object.

    How can I render a loading screen over the top of this web view? I want to have a better loading experience over the top of the web view, then hide it once the page is done loading. We were able to do this with another web view because we could render the web page in a game object or at least that was the container. Then I could put a custom load screen over that. Let me know if you have any tips on this. Thanks!

    in reply to: Where is webkit.messageHandlers.UnityInAppBrowser? #11673
    nategametaco
    Participant

    It is not working for us. Again, I don’t know how: webkit.messageHandlers.UnityInAppBrowser.postMessage is supposed to work if the JS doesn’t have the library to actually call anything. What are we missing? Can you send us a working example along with the JS that you would load into a browser? (Not just the Unity side like in the included example in the package.) npacyga@gametaco.com

    in reply to: Where is webkit.messageHandlers.UnityInAppBrowser? #11666
    nategametaco
    Participant

    We still haven’t gotten this to work. As far as we can tell we are following your example and readme. Any guidance is appreciated.

    I have this code on the Unity side:

    private void postMessage(string statusMessage) 
    {
         Debug.Log("[WebViewManager].postMessage -- status: " + statusMessage);
    }
    _inAppBrowserBridge.onJSCallback.AddListener(postMessage);
    _inAppBrowserBridge is set in the Unity Editor with the prefab in editor. 

    Here is the code on the JS side:

    thankYouClick() {
      const c = this;
      const { transactionId, method } = c.props;
      const { fromApp, depositAmount, hasBonusCashOffer } = c.state;
      const gameVersion = this.getParam('gameVersion');
      /** Set link to fire for unity web view messaging */
      const message = {
        status: 'success',
        total: depositAmount,
        method,
        hasBonusCashOffer,
        transactionId,
      };
      try {
        console.log({ message });
        webkit.messageHandlers.UnityInAppBrowser.postMessage(message);
      } catch (err) {
        console.log('Can not reach native code');
      }
    }
    • This reply was modified 1 year, 1 month ago by nategametaco.
    in reply to: Where is webkit.messageHandlers.UnityInAppBrowser? #11646
    nategametaco
    Participant

    Where is the Javascript library? It’s not included in the package, nor is it a URL. How do we call JS that isn’t included or found? What is the URL or path to the JS library.

Viewing 6 posts - 1 through 6 (of 6 total)