PassKit

Adobe Air Native Extensions


$29.99 $40.00



The FULL native iOS PassKit framework is now available to you as an AIR Native Extension.

The iOS PassKit native extension allows your app to integrate with Passbook in iOS 6.0 and later, including decoding passes, managing passes for your application, and presenting native views to add passes to Passbook. All of this comes in an easy high-level API, with a low-level API to ALL native PassKit calls in case you need to use advanced functionalities.

Important Note: This ANE only supports iOS 6.0 and later, but does not include other Passbook ecosystem components required to create, distribute, or redeem passes. Please consult the iOS Passbook Programming Guide for these components: https://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/PassKit_PG/Chapters/Introduction.html.

Requires iOS 6.0 SDK to build, but it can only be used with iOS 6.0 and up on devices and iOS Simulator.

Usage:

1. Add the ANE to the project and package for iOS.
2. Point to the iOS 6.0+ SDK in Package Configurations: Example:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/

3. Check if the ANE is supported on the current platform:

var supported:Boolean = PassKit.isSupported;

4. Create or get the singleton:

var passkit:PassKit = new PassKit();

or

var passkit:PassKit = PassKit.instance;

5. Check if the Passbook library is available:

var passAvailable:Boolean = passkit.isPassLibraryAvailable();

6. Create a pass from raw data:

var data:ByteArray; // data from a .pkpass file
var pass:PKPass = passkit.createPass(data);

7. Access info about a pass:

trace(pass.localizedName);
trace(pass.localizedDescription);
trace(pass.serialNumber);
trace(pass.relevantDate);
trace(pass.passURL);
addChild(new Bitmap(pass.icon)); // icon is a BitmapData

8. Access a static instance of the Passbook library:

var library:PKPassLibrary = passkit.library;
var passes:Array = library.passes();
for each (var pass:PKPass in passes) {
    trace(pass.localizedName + ", " + pass.localizedDescription);
}

9. Present the native Add View interface for a pass:

passkit.showAddPassView(pass);

10. Manage passes in library:

// replace with updated pass
var newPass:PKPass = passkit.createPass(newData);
library.replacePassWithPass_(newPass);

// remove old pass
library.removePass_(pass);