Iphone Facebook App not detected by krpanoJS

  • I have a problem detecting iPhone in facebook official App. I use different xml files for mobile/desktop so I used this detection in JS:

    Code
    if (viewer.isDevice("iPhone|iPod|Android|iPad")){
    } else {
    //here goes desktop xml
    }

    I checked in Apache server's access log and its headers are in attachment. I hope it helps.

    Is there anybody who has this problem?
    Is there any option i krpanoJS to detect this app ?

    Thank for help!

  • Thanks for reply!
    Yes, the method .isDevice is not detecting iPhone while using native iPhone facebook app.
    I am asking if there is an opportunity to use krpanoJS methods to detect its, otherwise I will have to parse somehow client's browser name (for FB app) in js or in PHP using my own method (need to write it), or even extend this method (viewer.isDevice) in js with new detection.

  • Hi,

    the isDevice() function is pretty simple, it just checks the occurrences of the given device strings in the the Javascript 'navigator.userAgent' string...

    an alternative to 'navigator.userAgent' can be 'navigator.platform', but it depends to what values the Facebook app is setting these variables...

    can you please try adding that code in your page and try it in the Facebook app and post the alert string:

    Code
    alert("platform="+navigator.platform+" useragent="+navigator.userAgent);

    best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!