Black screen on Facebook playable ads manager

I’ m trying to create a playable ad game for facebook. Haven’t finished yet but I wanted to check if everything were ok before continuing. Unfortunately when I upload the playable assets the preview shows just a black/grey screen without an error.

I tried to troubleshoot changing various stuff in the config.json but with no result.

My next step was to build the playable example

The result was the same.

Sizes for both apps are under 5mb for the zip file. (since I saw similar issue from someone)

Does anyone have an idea what is going on?

I’m attaching the config file in case someone can spot something amiss.

{
    "playcanvas": {
        "project_id": 1054444,
        "name": "PlaybaleExample",
        "scenes" : [1701187],
        "branch_id": "d4c9722f-7415-4452-af12-5647aa4f2d83",
        "description": "",
        "preload_bundle": false,
        "version": "",
        "release_notes": "",
        "scripts_concatenate": true,
        "scripts_sourcemaps": false,
        "scripts_minify": true,
        "optimize_scene_format": false,
        "engine_version": ""
    },
    "csp": {
        "style-src": [
            "'self'",
            "'unsafe-inline'"
        ],
        "connect-src": [
            "'self'",
            "blob:",
            "data:",
            "https://*.google-analytics.com"
        ],
        "patch_preload_bundles": false
    },
    "one_page": {
        "patch_xhr_out": false,
        "inline_game_scripts": true,
        "extern_files": {
            "enabled": true,
            "folder_name": "",
            "external_url_prefix": ""
        },
        "mraid_support": false,
        "snapchat_cta": false,
        "compress_engine": true
    }
}

and my project link

Last, but not least. Awesome engine. Great job, to anyone involved.

EDIT: I also tried the playcanvas builds in an Ironsource playable ad just to verify that it isn’t a facebook thing. I get the same issue there also. Weird thing is that they play just fine if I open them in the browser, locally.

Do you get an errors in console? I vaguely remember that the browser preview tools for FB didn’t work and was fine when testing them on device.

I will take another look when I’m back in the office on Monday if you still have issues.

No. No errors on the console.

And I’m not using the preview tool. There seems to be a bug there that responds with an error about the size of the zip even though it is under 5mb. The screenshot is from the ads manager where you have to test the CTA click in order to proceed.

If you can find the time and test it with your own example and let me know if it is reproducible, it would be a huge help.

IIRC, the contents have to under 5MB, not the ZIP

It would be worth forking something like Flappy Bird | Learn PlayCanvas and testing that as an ad

Either way, I will try to find some time to test on Monday.

1 Like

Nope. Same thing with the Flappy Bird example.

I think I will have to wait for news from you on Monday.

Hi @RabidRadbit,

Taking a look at the documentation here for Facebook specific configurations:

https://developer.playcanvas.com/en/user-manual/publishing/playable-ads/fb-playable-ads/

It looks like you are not patching out XHR requests. My understanding from the full repo here:

and the example is that Facebook automatically blocks out XHR requests. This may be a part of your issue.

Consider changing your one-page configuration to:

...
    "one_page": {
        "patch_xhr_out": true,
        "inline_game_scripts": true,
        "extern_files": {
...
1 Like

@eproasim Your suggestion was correct.

For the playable examples it needed the “patch_xhr_out” and “inline_game_scripts” flags set to true.

For my project there was also a silent error with the custom loader. It seems that they don’t play well with the one_page modifications. It’s not an issue for me at this time.

Thank you both for your help.

In the tool, I remove the loading script as I deemed it not needed since playable ads are usually downloaded to the device ahead of time.

Do you think the loader is still needed for ads?