Question

I am trying to create a request flow in our canvas app that uses frictionless requests to allow sending requests while in fullscreen.

The problem I don't see a solution for is how to detect when sending a request will pop up a UI dialog, and when it will not. If I send a request specifically to one or more users, and any one of them does not yet have frictionless requests turned on, I will need to break out of fullscreen so that the FB UI dialog can show.

However, if the user has previously sent requests and checked the frictionless checkbox, we don't need to break out of fullscreen.

How do I know whether or not a UI dialog is going to show? At first I thought that the hideFlashCallback could be used, but it seems like this is only fired for Facebook elements such as the notification panel, not for dialogs that the app itself initiates.

Thanks in advance for any assistance or ideas! I know that there are games on FB that handle this properly, but I cannot figure out how they are doing it.

Was it helpful?

Solution

As far as I'm aware there is no way to detect this via the API. You may be able to detect it in the DOM but you'd be opening yourself up for breakage with FB updates by using undocumented features.

What you could try is setting a timeout to break fullscreen and if your callback gets a response right away then you could cancel it. You'd have to fudge the timeout's duration based on how long the API usually takes to do the callback in frictionless requests but you could probably get this working with something like 250 or 500 milliseconds.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top