Sie sind nicht angemeldet.

fotopano

Anfänger

  • »fotopano« ist der Autor dieses Themas

Beiträge: 8

Wohnort: Gdynia

Beruf: Webdesginer

  • Nachricht senden

1

Dienstag, 17. April 2012, 19:06

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:

Quellcode

1
2
3
4
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!
»fotopano« hat folgendes Bild angehängt:
  • fb_app_iphone_headers.jpg

2

Donnerstag, 19. April 2012, 15:28

Hi,

what's the problem exactly?
is it the 'isDevice' detection or the viewer itself?

best regards,
Klaus

fotopano

Anfänger

  • »fotopano« ist der Autor dieses Themas

Beiträge: 8

Wohnort: Gdynia

Beruf: Webdesginer

  • Nachricht senden

3

Dienstag, 24. April 2012, 10:10

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.

4

Dienstag, 24. April 2012, 16:53

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:

Quellcode

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


best regards,
Klaus