Topic-icon Canvas template not loading on first visit

Active Subscriptions:

None
I have two templates: one for my Site ("myTemplate"), one for the Canvas App ("myTemplate_Canvas").

I configured JFBConnect to use "myTemplate_Canvas" with Automatic Resising Disabled.
It works almost fine, but...
  1. I logout from my site (I have "Logout Of Joomla Only"="No" - so it also logs me out from FB)
  2. I login to FB (at www.facebook.com, not my site)
  3. I visit my Cannvas App - and it uses "myTemplate"
Now... the "almost" part... this only happens the first time I visit the Canvas App - If I refresh the browser or visit it later on this same session, it works fine with "myTemplate_Canvas".

If
  • I login via JFBConnect on my site
  • I login via Facebook and then visit my site (thus logging in automaticaly)
when I visit the Canvas App it works fine with "myTemplate_Canvas".


This is a very important issue, since the most of my users will use the Canvas App... and will have a very messy layout in most visits (any first visit after logging in to FB).

I am using JFBConnect 3.4.1.

(don't you just hate this kind of bugs? ;) )
The topic has been locked.
Support Specialist
14 years 9 months ago #13060 by alzander
Yeah, that's an interesting one. With the way we do Page Tab/Canvas detection, I'm not sure how that's happening.. but we'll definitely try to recreate that issue and see if we can get a fix into the 4.0 release. We're making some minor changes to the Page Tab/Canvas detection already to account for Facebook's switch to OAuth2 as well as some other minor issues users encountered with 3.4.

Hopefully, this is easy to recreate and fix.

Thanks for pointing it out, and we'll keep you posted on what we find!
Alex
The topic has been locked.
Active Subscriptions:

None
In the meantime, I solved it like this by placing this JavaScript on myTemplate index.php file:
var isInIFrame = (window.location != window.parent.location) ? true : false;
if (isInIFrame) {
	window.parent.location='my facebook canvas app url';
}

This forces facebook to refresh, and the template is loaded correctly.

I went the easy way, by forcing FB to refresh, rather than trying to solve things via PHP / Joomla (v.g. forcing the template to load and refreshing the site)... Why? Facebook is quite a mistery to me, and I do lot like to deal with it programmaticaly... I leave that to the experts (AKA SourceCoast) ;)
The topic has been locked.
Support Specialist
14 years 9 months ago #13091 by alzander
Interesting code. It's very similar to how we detect when the user has left Facebook and is viewing your site 'live' and not in an iFrame :)

We'll be looking into this issue likely tonight or tomorrow morning, and let you know what we find.

Thanks again for the feedback.
The topic has been locked.
Support Specialist
14 years 9 months ago #13115 by alzander
Alexandre,
Nope, we can't recreate this from some quick testing. Can you let me know the following info:
1) Do you have to login and then out of your Joomla site for this to occur, or does it happen the first time you go to your Facebook Canvas app regardless of whether you've visited the Joomla site previously?
2) Have you tried multiple users, especially Facebook user's who are not the admin of the app?
3) I know you've sent it before, but can you send your URL to us as well as your Canvas App URL so we can test? We periodically clean out our PM box for various reasons, so I don't have it there anymore.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
1) The first time I go to my Facebook Canvas app, regardless of whether you've visited the Joomla site previously - to test it you should log off from Facebook;

2) Yes, multiple users - both FB App Admin and "normal" users

3) I haven't ;) The site is still beta and the english part is not translated yet... you'll have to manage with the Joomla Language constants. Site and App URL sent by PM.

If the site goes "KABOUM"... don't worry... its beta. ;)
The topic has been locked.