I am having trouble recently with old users. It is a scenario that is hard to test. Old users are getting errors when I try to force them to use the Enhanced Auth Dialog to add the app to their timeline. I should remark that everything works fine for new users.
Old users authenticate just fine, but if you try a timeline action, they get a #200 error saying publish_actions is needed. Which is expected. So I am trying to solve this is by 1.) checking the join_date of a user to my app. If that date is before I made the enhanced switch then 2.) I check their permissions.
If they don't have publish_actions, like so, I do this:
if(!array_key_exists('publish_actions', $permissions['data'][0]) ) {
$gotoURL = APP_URL."?page=home";
$cancelURL = APP_URL."?page=terms&cancel=1";
$url = $facebook->getLoginUrl(array('canvas' => 1, 'fbconnect' => 0,
'scope' => 'publish_actions',
'redirect_uri' => $gotoURL,
'cancel_url' => $cancelURL));
echo "<html><body><script>window.parent.location='".$url."';</script></body></html>";
exit;
}
For some reason, that seems to put them in a redirect loop. I have the latest php sdk, so I don't really know what the issue is, and like I said, it is difficult to test. Any thoughts off hand as to what the problem/solution could be? Is there a better way to do this?