- Home /
Get token back in unity
Hi Guys
I am working on instagram for web player. for getting token i hit the api in unity and open a popup window use by Application.ExternalCall("OpenPopUp"); code is
function OpenPopUp()
{
var F = 0;
if (screen.height > 500)
{
F = Math.round((screen.height / 2) - (250))
}
window.open ("https://instagram.com/oauth/authorize/?client_id=%clientID%&redirect_uri=http://localhost/~nitin/12julyInstgram/build/instagram_new.html&response_type=token","Instagram","menubar=1,resizable=1,width=500,height=500,scrollbars=1,left="+Math.round((screen.width/2)-250)+",top="+F);
}
this is working fine a popup window open and token is there below is screenshot][1]
There is a html file in my build folder so there is 3 file now in my build folder build.html,build.unity3d and redirect html)and i give that html path as redirect url in instagram and in my api .
the problem is i want to get that token in unity back.i tried but not get any success i tryed below link method also
http://docs.unity3d.com/Documentation/Manual/UnityWebPlayerandbrowsercommunication.html
i get that token in a var in my html file code is
alert(access_token); this alert is working fine I don't Know I am Doing right or not ,so Suggest me best way to get that token in unity back.I am in big trouble and sorry for my english Thanks in advanceaccess_token = window.location.hash.split('&')[0].replace('#access_token=', '');
What does "i tried but not get any success i tryed below link method also" mean? The link to the docs talks about Send$$anonymous$$essage()
. What happened when you used that?
Your answer
![](https://koobas.hobune.stream/wayback/20220613110001im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers
Passing active camera images to browser 1 Answer
WebPlayer UnityObject2.getUnity().SendMessage() method is missed in IE 11 2 Answers
IsLoaded function for Browsercommunication? 1 Answer
Any caching options available for things dynamically loaded by WebPlayer? 0 Answers