Search code examples
facebookunity-game-enginefacebook-unity-sdkunity-web-player

How can I fix this error in Facebook's Unity SDK Pay dialog?


I am adapting a Unity project to run in the web player, for integration with Facebook's Canvas, and specifically the FB In-App Purchase system. The conversion is nearly finished and as recent as a couple weeks ago I had verified that every possible choice under the IAP options worked perfectly and would resolve transactions correctly. However, the asynchronous payment option has suddenly begun failing with a strange error message that seems unconnected to any Unity code or the web server that was set up to host the game.

When a player selects the asynchronous payment option and clicks on confirm in the FB Pay dialog, the dialog does not close and an error is output to the debug console:

TypeError: undefined is not an object (evaluating 'window.parent.require("GamePaymentProviderIFrameFlow").processIFrame')

redirect.php

This is the error output for Safari and the other browsers give similar messages indicating that "processIFrame" is not recognized because "window.parent.require(...)" is returning an undefined reference.

Now I'm not sure where "redirect.php" actually is, but from what I've been able to gather, it looks like it's looking for and failing to find a module called "GamePaymentProviderIFrameFlow". I can't find any information on whether this is something that happens as part of the Facebook Unity SDK or something on Facebook's servers. I did find that the "require" call is most likely a part of Node.js and would therefore not be run in the player's browser, but rather on a server.

I am using Unity version 4.3.0f4 and Facebook Unity SDK version 6.2.2. I haven't touched anything with regards to the payment system in the time since it worked correctly and although I know this is no guarantee, the error doesn't seem to be happening within Unity at all. The only possibility I can think of is that some FB communication with the FB Unity SDK has begun failing due to some change in the Facebook API. If that's true, however, I don't know if there's any reasonable way to fix this other than to wait for a patch from FB.

Has anyone else encountered this or something similar or could provide any other advice on this topic?


Solution

  • Found a bug report on Facebook's dev site that details the exact problem I'm having. Apparently this is a known UI issue and is in the process of being addressed.

    https://developers.facebook.com/bugs/145796563404096/

    Guess i'll just have to wait.