Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

231
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!