I developed an app with Ionic 4 and I’m trying to copy some text on a mobile’s clipboard. I’ve tried with the javascript function addEventListener. It works as expected on a desktop, but when I try to use it on a mobile, nothing gets copied. This is the code I used, just in case:
Prepare a small example on stackBlitz for you, this works for me on mobile devices
Function
Html
you need to send the id of the item you are going to copy
Thank you for the reply, @crmontiel It works perfectly on a desktop, but when I upload the changes to use it on a mobile device, the text just doesnt get copied. Have you tried it on your mobile?
No hay problema. jaja
Perdon pero quizás no lei detenidamente tu problema y solo me base en la parte superior de tu post.
en web app puedes utilizarlo de esta manera
Realmente no hay que instalar nada porque eso utiliza el WDK
pero si gustas puedes revisar más a fondo el tema por aca
Si eso no te funciona me avisas y busco otra manera, lo raro es que yo estoy usando una pwa y me funciona, y si la despliego como apk o ipws tambien me funciona
Hay algún bug en Ionic 4. Si pongo solo navigator.clipboard.writeText('aasdf'); en una función y la hago correr, sale Compiled successfully. Pero justo después me aparece el error que te mandé antes. De todas maneras, como te digo, se compila bien y se guarda en el clipboard, al menos de mi desktop. como no puedo hacer un builg, no me deja subirlo.
Listo un gusto haber intentado ayudarte, espero encuentres el fallo porque como te comente a mi me funciona correctamente en PWA y la tengo desplegada en HTTPS en una url de la empresa donde laboro funciona bien como te lo comente.
Subí una web app con Ionic y en iOS, cuando pasa de una página a otra por primera vez, tarda muchísimo en hacer el cambio. Sabes si hay alguna manera de quitar el lazy loading y cargar todas las páginas de golpe?