Question

I tried calling:

Application.ExternalEval("UnityObject2.instances[0].getUnity().SendMessage('GameObjectName', 'SomeFunctionHere', document.URL);");

Which works great, but it could only retrieve the frame's url (it is a very long random html link) instead of the outer top most like https://apps.facebook.com/appnamehere. I also tried window.top.location.href but it gives me a security error since it wasn't allowed.

I need to process the url before I even init, so I cannot use fb's deeplink or anything like that. Any ideas on how to get the url? I'm using 5.0.4 of the SDK on Facebook Canvas.

Was it helpful?

Solution

Because of cross-domain security, it isn't possible to get the top url.

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