0

My question may sound like "already asked", but I cannot find any answer. My problem is :

I have a phonegap app that only display a remote website (that website is responsive and work perfectly on mobile device). So the app is very simple :

function onBodyLoad() {
    document.addEventListener("deviceready", function(){
        location.href = "http://www.mydomain.com/";
    }, true);
}

As you can see this I just a redirection when that app starts. With that method I have no access to phonegap API after the redirection (am I right?).

My question(s) is: is that method the right method? How can I display/hide element on a webpage depending on the webpage is accessed by the app or by mobile browsers?

Thank you so much

Greg

Greg
  • 167
  • 2
  • 10
  • Try to read the UserAgentfrom the Device asking the website and hide/show the elements via php, or you could set a get param for the request like www.mysite.com?user=app – A.S. Oct 23 '13 at 09:32
  • you can use browsers useragent field to decide between browsers – Illegal Argument Oct 23 '13 at 09:32

1 Answers1

0

Just be aware that you are not allowed to do this from Apple.

From the App Store Review Guideline

2.12 Apps that are not very useful, unique, are simply web sites bundled as Apps, or do not provide any lasting entertainment value may be rejected

rckoenes
  • 69,092
  • 8
  • 134
  • 166
  • 1
    Thanks for your answer. Is there another way to do that? – Greg Oct 23 '13 at 10:12
  • To do what ?, you have to be more clear. As stated by rule 2.12 wrapping site in an app is just not allowed. You will need to make a real app not just a wrapper around the existing website. – rckoenes Oct 23 '13 at 10:16