1
votes

I've decided to integrate new facebook unity sdk, so far I've been using custom web page with embeded unity player.

I've configured Facebook App by enabling "Unity Integration Enabled:" and providing URL of Unity Binary with my application.

Question is: How to access URL parameters in such setup?

For instance If somebody clicks link https://apps.facebook.com/myapp/?inviter_id=123 I'd like to access "inviter_id" from within Unity. So far I had it implemented in javascrit on my own website containing web player and I just passed it as parameters when calling unityObject.embedPlayer so in Unity I could access it with Application.srcValue At this moment I'm not providing own website/js only .unity3d file.

2

2 Answers

4
votes

This is coming soon in the next SDK update. It will be available on iOS, Android and Facebook Canvas.

SDK 4.3.3 Update: The SDK now has this functionality for all three platforms: Canvas, iOS, and Android. Look at FB.GetDeepLink().

https://developers.facebook.com/docs/unity/reference/current/FB.GetDeepLink

1
votes

After some digging I found out that best way is to uxecute javascript cod that is passing window.location.href back to Unity:

        Application.ExternalEval(
        "UnityObject2.instances[0].getUnity().SendMessage('FacebookCallbackGO', 'InitializeForFacebook', window.location.href);"
        );