1

I am developing event app, in which, once user done with booking event ticket then, we have to add that pass to Apple wallet.

I am following below link to design my pass, https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/PassKit_PG/Creating.html

But the problem is I have completed the JSON, but how can I add ticket to wallet using code.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Dhiru
  • 3,040
  • 3
  • 25
  • 69

1 Answers1

0

You just need to follow the steps described in the Apple documentation:

  • Create a directory structure, containing the pass.json file, images etc.
  • Create an SHA-1 hash of every file and store it in manifest.json on top-level
  • ZIP the contents of the directory
  • Distribute the file using application/vnd.apple.pkpass MIME type

Once you get the file into your application:

  • Read the file (e.g. using Data(contentsOf:))
  • Hand it into PKPass(data:)
  • Present the pass to the PKAddPassesViewController
Raptor
  • 53,206
  • 45
  • 230
  • 366
Andreas Oetjen
  • 9,889
  • 1
  • 24
  • 34