add-to-homescreen icon indicating copy to clipboard operation
add-to-homescreen copied to clipboard

Nothing Happens...? [SOLVED]

Open NicholasEli opened this issue 8 years ago • 13 comments

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

NicholasEli avatar Nov 11 '16 04:11 NicholasEli

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

<script>
addToHomescreen();
</script>

holtkamp avatar Nov 11 '16 10:11 holtkamp

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

NicholasEli avatar Nov 13 '16 02:11 NicholasEli

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.

NicholasEli avatar Nov 13 '16 04:11 NicholasEli

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

holtkamp avatar Nov 13 '16 15:11 holtkamp

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.

PearlyGates avatar Dec 09 '16 23:12 PearlyGates

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

devcpp-a1 avatar Dec 24 '16 04:12 devcpp-a1

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

ThatAndresV avatar Mar 20 '17 11:03 ThatAndresV

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

x10sys avatar Aug 09 '17 16:08 x10sys

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.

x10sys avatar Aug 09 '17 16:08 x10sys

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 [email protected]:

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.

PearlyGates avatar Aug 09 '17 20:08 PearlyGates

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

x10sys avatar Aug 10 '17 08:08 x10sys

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?

mashirozx avatar Jan 05 '18 17:01 mashirozx

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

mangolino avatar Aug 27 '18 10:08 mangolino