cubiq / add-to-homescreen

Add to home screen call-out for mobile devices
http://cubiq.org/add-to-home-screen
2.29k stars 748 forks source link

Nothing Happens...? [SOLVED] #243

Open NicholasEli opened 7 years ago

NicholasEli commented 7 years ago

I have include the source files and shot them to a server to test on a mobile device. But nothing happens. The online demo page works, but the git repo files do not?

nicholasbydesign.getforge.io

holtkamp commented 7 years ago

On http://nicholasbydesign.getforge.io you only include the files. Now you also have to start the script:

<script>
addToHomescreen();
</script>
NicholasEli commented 7 years ago

I did, it is in the head of the document as per the demo.

NicholasEli commented 7 years ago

I found after doing some digging there is a object in localstorage. This prevented mine from working after viewing the demo and then running my own code.

holtkamp commented 7 years ago

mmm, you marked it as solved? Can you close the issue then?

PearlyGates commented 7 years ago

I am having the exact same issue right now. Your page and the online demo page from cubiq work fine. Mine doesn't. Could you maybe elaborate how you got it fixed? Especially since I can currently use both sites and it's working on both I don't quite understand how a localstorage object is preventing the popup on my own site.

devcpp-a1 commented 7 years ago

@PearlyGates try adding the addToHomeScreen script to the bottom of your document instead where its at currently (header), that fixed my issue.

ThatAndresV commented 7 years ago

Yes, same fix (keep script in the header, but call it later in the page) works for me too.

x10sys commented 7 years ago

Unfortunately, I have the same problem. Calling the script right before the </body> also does nothing :(

x10sys commented 7 years ago

Ignore my problem. It is solved. I'm new to web apps so I didn't know i had to add both addtohomescreen.js & addtohomescreen.min.js to my site.

PearlyGates commented 7 years ago

Sorry for the late answer. But just so you know: Having to add both the min and the normal .js file should normally not be the solution.

Files that are named {filename}.min.js have been minified, which actually just means, that the content has been shortened by some kind of tool. The min and non-min file are essentially exactly the same.

Von meinem iPhone gesendet

Am 09.08.2017 um 18:57 schrieb x10sys notifications@github.com:

Ignore my problem. It is solved. I'm new to web apps so I didn't know i had to add both addtohomescreen.js & addtohomescreen.min.js to my site.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

x10sys commented 7 years ago

@PearlyGates That is exactly what I thought. But it didn't work till I've copied normal .js. Strange...

mashirozx commented 6 years ago

Seems not work with a pjax based site (same scripts worked fine in a blank html file) :( Must I use \<a> tag as the "Add to bookmark" button?

mangolino commented 6 years ago

Hi! Please can You tell me how to hide the banner after example 3 visit on the page?