Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

232
Vistas
Download and open pkpass from server in react

I have tried like everything but it isn't working. I am creating a apple wallet pass via https://github.com/walletpass/pass-js When I download it on the node serve where I have implement it, I am getting a valid pass and can load it to the wallet. But when I am download the pass through my react app I am getting a buffer. When decode that buffer I am getting the (looks like) same data content like that from server. But when I am saving that stuff, the size is 113kb and not like the size of the pass I created on the server 65kb and its no valid pkpass file.

Maybe someone has that problem too?

My server code:

   return h
     .response(walletData)
     .type('application/vnd.apple.pkpass')
     .code(200)

My React code:

      .get(`/appleWalletCard/${user.me._id}`)
      .then((response: any) => {
        if (response) {
          const file = new Blob([response.data])
          console.log(file)
          const fileURL = URL.createObjectURL(file)
          const link = document.createElement('a')
          link.href = fileURL
          link.click()
        }
      })
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Here is the solution: You have to set the responseType to array buffer.

.get(`/appleWalletCard/${user.me._id}`, {
        responseType: 'arraybuffer'
      }
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda