Giter Site home page Giter Site logo

xl-passbook-ruby's Introduction

Passbook-Ruby

Build Status

Passbook is an app distributed on iOS6. This is an implementation for management and signing of pkpasses for your Rails application. The management of templates and all the other data is done in-memory. This gem does not write to the filesystem. This results in a speed boost.

Quick Start Video:
http://www.youtube.com/watch?v=GeWFk1FvEKc

Usage

Install

gem 'passbook-ruby'
bundle

P12 certificate

This the first of 2 certificates you need to sign a pkpass. Apple has a step-by-step for most of it. You can pick up from step 7. Alternatively, you can follow all of my steps:

  1. Go to iOS Provisioning Portal (you need to login or register)
  • Click on "Pass Type IDs" on the left side menu
  • Click on "New Pass Type ID" and fill in the 2 fields
  • After you come back to the listing of pass type ids, click on "Configure" link next to the one you created
  • Click on Configure button and follow the instructions in the wizard
  • Once you download the pass.cer, double-click to install
  • In the "Keychain Access" tool right-click on Pass Type ID: <you.pass.id> and click "Export "Pass Type .....""
  • Change "File Format" to "Personal Information Exchange(.p12)" and save (preferably to Rails.root/data/certificates/)
  • The password you enter during the saving process will go into the initializer ("Run Generator" step)

WWDR Certificate

Second certificate you need to sign a pkpass

  1. Download http://developer.apple.com/certificationauthority/AppleWWDRCA.cer
  • Double-click to install
  • In the "Keychain Access" tool right-click on "Apple Worldwide Developer Relations Certification Authority" and click on Export "Apple....
  • Change "File Format" to "Privacy Enhanced Mail (.pem)" and save it (preferably to Rails.root/data/certificates/)

Run generators

All the parameters are optional. You can just edit the initializer later

   rails g passbook:config [wwdr_certificate_path]

That creates an initializer and a migration. Don't forget to put the WWDR certificate into the path now, if you used the defaults.

After that, let's create a pkpass model (ie. ticket). I would strongly advise specifying model_name, pass_type_id and tead_id at this points.

   rails g passbook:pkpass [model_name] [pass_type_id] [team_id] [cert_path] [cert_password]

This will generate a model, a migration, an initializer, a route and a sample pass (to data/templates/your_pass_type_id). Make sure to add your .p12 into the path now if you use the defaults. Also, if you didn't set the password for the cert in the above command, make sure you change the default to your password in config/initializers/passbook_#{model_name}.rb.

   rake db:migrate
   rails s

and go to \passes\model_name on your iphone (make sure it is in debug mode and allows http connections)

Check out FAQs wiki section if you get in trouble

####Thank you for help: Dwayne Forde, Cody Veal, Gregory Chow, Vincent Lee, Hussam Sheikh, Tanzeeb Khalili, Vincent Coste

####License

Except as otherwise noted, the Passbook-Ruby gem is licensed under the Apache License, Version 2.0

xl-passbook-ruby's People

Contributors

cjhveal avatar xtreme-andrei-dinin avatar

Watchers

 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.