• Appnext and Unity (Facebook game) posted


    I'm trying to integrate app next into my unity game, to be available on facebook. The game is using the Facebook SDK, soI have to use Inject in order to modify things around the canvas. I use the provided code to display an express bar. My code looks like this:

    Application.ExternalEval ("<iframe id="top_banner" src="//" align="center" width="760" height="72" marginwidth="0" marginheight="O" hspace="0" vspace="0" style="border:solid 1px;border-radius: 1opx" scrolling="no"></iframe>");

    I get an error: CS1525 Unexpected symbol 'top_banner'.

    Does anyone know how to fix this?

  • Hi,
    So sorry for the late reply, I fixed a few things in your code, can you try using this:
    Application.ExternalEval ("<iframe id='top_banner' src='//' align='center' width='760' height='72' marginwidth='0' marginheight='0' hspace='0' vspace='0' style='border:solid 1px;border-radius:10px' scrolling='no'></iframe>");

    Please let me know if it solves your issue.
    Best regards,

  • I've just done the same thing. However, I gave myself a bit more control by creating my injection as a link (as shown below) to the same site that hosts my game ( and then injecting an iFrame to that page. That way, I can edit the content of my web page without the need to rebuild and upload a new version of the app. Obviously this will only work if you can create a page on the same host that's hosting the game (like and it MUST be https://

    using UnityEngine;
    using System.Collections;
    public class WebInjection:MonoBehaviour {
        void Start() {
            string injection =
                "ifrm = document.createElement('IFRAME');" +
                "ifrm.setAttribute('src', 'https://<domain/page>');" +
                " = '100%';" +
                " = '200px';" +
Loading ...