Page 1 of 1

iPhone is not recognised

PostPosted:Fri Aug 20, 2010 9:27 am
by joergweis
I have an installation of the current 4.1 version of openKM. So far nearly everything is fine except, that when I connect my iphone browser to the url where openKM resides I do not get the iphone optimized view. When I point my iphone to the openkm demo site it works fine, what can there be the problem? i have found so far no documentation in the wiki about that.

Re: iPhone is not recognised

PostPosted:Fri Aug 20, 2010 10:13 am
by jllort
could be a bug with version 4.1 really we detect the browser and then change ... you could try directly with this url
Code: Select all
http://host:8080/OpenKM/mobi/

Re: iPhone is not recognised

PostPosted:Fri Aug 20, 2010 11:00 am
by joergweis
HI, thanks for the hint, I am redirected to the mobi page but the rendering is too small, if I go to your demo it works flawless. Is it possible to get the 5.0 beta?
regards Jörg.

Re: iPhone is not recognised

PostPosted:Sun Aug 22, 2010 8:23 am
by jllort
Until september version 5.x it'll not be available to community, now only we've installed to some of our clients because needs mandatory some of features only presents in version 5.

Re: iPhone is not recognised

PostPosted:Mon Aug 23, 2010 2:45 pm
by joergweis
thanks, but have you tried on a lower version than 5.0 if it works at all? So I can close this if it is not possible with 4.x, regards.

Re: iPhone is not recognised

PostPosted:Tue Aug 24, 2010 7:46 am
by jllort
Yes i was tryed in 5.x, 4.0 and 3.x but not at 4.1, probably could be a stupid bug in that version.

I take a look at source code at seems is right. The key to switch normal or mobile is on index.jsp file into OpenKM.war.

index.jsp makes it comprovation:
Code: Select all
if (FormatUtil.isMobile(request)) {
		url = "mobi/index.jsp";
	} else {
		url = "es.git.openkm.frontend.Main/index.jsp";
	}
And FormatUtil class makes it
Code: Select all
public static final boolean isMobile(HttpServletRequest request) {
		String userAgent = request.getHeader("user-agent").toLowerCase();
		return userAgent.contains("android") || userAgent.contains("iphone");
	}
Code from OpenKM 4.1 seems right ... could you make a change into your index.jsp including it, and tell me the output:
Code: Select all
System.out.println("detected agent:" +  request.getHeader("user-agent").toLowerCase());
in your server.log it'll appers the agent detected. That could help us to understand what's happening.

Re: iPhone is not recognised

PostPosted:Tue Aug 24, 2010 10:39 am
by joergweis
Hi, thanks for the input I changed index.jsp and the iphone is detected, see system.out from server.log:
2010-08-24 12:31:20,012 INFO [STDOUT] detected agent:mozilla/5.0 (iphone; u; cpu iphone os 4_0_1 like mac os x; de-de) applewebkit/532.9 (khtml, like gecko) version/4.0.5 mobile/8a306 safari/6531.22.7
I have also attached a screenshot how it looks like on my iphone.

Re: iPhone is not recognised

PostPosted:Tue Aug 24, 2010 11:14 am
by jllort
now dectects iphone and before not ?

Re: iPhone is not recognised

PostPosted:Thu Sep 02, 2010 8:30 pm
by joergweis
yes iphone was detected everytime but when I log into your demo the screen is fullscreen here I only get what see on the prior posted screenshot.

Re: iPhone is not recognised

PostPosted:Fri Sep 03, 2010 8:41 am
by jllort
Now I'm confused, the problem is on our online demo or in your local installation ?

I've tested our online demo with my android and runs well ( sorry but I've not an iphone now, I'll test it too with iphone later ).