Giter VIP home page Giter VIP logo

php-pkpass's Introduction

PHP PKPass class for iOS 6 Passbook

This class provides the functionality to create an Pass for Passbook in Apple's iOS 6 on-the-fly. It creates, signs and packages the Pass as a .pkpass file according to Apple's documentation.

Please also take a look at my repository PHP-Passkit, which includes the PKTemplate and PKValidate classes, to easily manage templates and validate pass files.

Requirements

  • PHP 5
  • Access to OpenSSL and Zip via PHP's exec()
  • Access to filesystem (script creates a directory temp/ for temporary files)

Usage

Please take a look at the example.php file for example usage. For more info on the JSON for the pass and how to style it, take a look at the docs at developers.apple.com.

A live demo of the full sample can be found on http://www.tomttb.com/test/pass/full_sample.

Please note that iOS 6 and Passbook are still in beta, which means that the API can change at any moment. As new beta releases of iOS 6 come up, I'll try to update the class as soon as possible and add more features.

Requesting the Pass Certificate

  1. Go to the iOS Provisioning portal
  2. Create a new Pass Type ID
  3. Request the certificate like shown
  4. Download the .cer file and drag it into Keychain Access
  5. Right click the certificate in Keychain Access and choose Export 'pass.<id>'…
  6. Choose a password and export the file to a folder

Getting the example.php sample to work

  1. Request the Pass certificate and upload it to your server
  2. Set the correct path and password on line 6 and 7
  3. Change the passTypeIdentifier and teamIndentifier to the correct values, which can be found on the iOS Provisioning portal after clicking on 'Configure' next to the Pass ID, on line 10 and 14

After completing these steps, you should be ready to go. Upload all the files to your server and navigate to the address of the example.php file on your iPhone.

Support

For info, mail me at [email protected] or tweet me @tschoffelen.

php-pkpass's People

Contributors

tschoffelen avatar dododedodonl avatar chao avatar mac-cain13 avatar

Watchers

José Gilberto Mullor avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.