Posted By

abrady0 on 09/25/13


Tagged

Unity facebook-unity-sdk


Versions (?)

getting invoking url and params


 / Published in: C#
 

quick example of how to get invoking URL in unity

  1. // dispatch message. note 'GameObject' is euphemism for whatever game object will have the script attached to it.
  2. if (Button ("Get Invoking URL"))
  3. {
  4. Application.ExternalEval(
  5. "u.getUnity().SendMessage('GameObject', 'OnInvokingParamsResponse', window.location.href);"
  6. );
  7. }
  8.  
  9. // assuming this script is attached to 'GameObject' this function will be invoked
  10. public void OnInvokingParamsResponse(string res) {
  11. Debug.Log("invoking params res: "+res);
  12. }

Report this snippet  

You need to login to post a comment.