facebook apps redirect to hosting url in the first

2020-02-02 02:29发布

问题:

I built a facebook apps from an tutorial with using adobe flash builder 4.5 . It is hosted on heroku.

This app gets name, image, birthday and status message . It displays these infos in the screen. And you can also post status message to your fb account. As you understand, it is very simple apps.

In the first usage of this app, after permission dialog, url is redirected to hosting url.

When you want to use it again, You can use it on facebook.com

do you have any idea why it is redirected to hosting url in the first usage after permission dialogs.

Thanks, cergun

回答1:

Selam Ceyhun,

This is expected behavior, what you can do for this is simply:

<script type='text/javascript'>
if (window.top.location == window.location) 
  window.top.location = 'https://apps.facebook.com/myapp';
</script>

that's it.