开发者

Can I add additional content to my iPhone-targeted web app when the user clicks on “add to home screen”?

开发者 https://www.devze.com 2023-02-16 02:27 出处:网络
I developped a website with webapp capability. Is it possible to add some additional content to this webapp ?

I developped a website with webapp capability. Is it possible to add some additional content to this webapp ?

I mean : My webapp is basically a html/css/js website adapted to iPhone screen & capabilities. When someone visits this website & click on "add to home screen" button, this website "become" a webapp, with shortcut icon, launchscreen... Etc.

The webapp content is almost the same as my website adapted to iPhone screen & capabilities (+ splashscreen & shortcut icon).

I want to add some more co开发者_C百科ntent in my webapp (than in my website ; but not in my website) : - a string to thanks users who added it to their home screen, - special or additional content in comparison with the common website, Etc.

My question is simple : is it possible ? How can I do the trick ?

Thanks to all,

Nico.


This works a charm...

<script>

       if (window.navigator.standalone == true) {
         document.write('<p>Welcome Home</p>');
       }else{
         document.write('<p>Tap the + button and choose "Add to Home Screen"</p>');
         document.write('<link rel="apple-touch-icon-precomposed" href="icon@2x.png"/>');
       }

    </script> 
0

精彩评论

暂无评论...
验证码 换一张
取 消