PassSlot Class Reference
Inherits from | NSObject |
Declared in | PassSlot.h |
Overview
This class is the core of PassSlot.
You can start PassSlot using your app key. You can then create passes from templates, change values of passes or add passes to passbook.
[PassSlot start:@"<you app key>"];
NSDictionary *values = [NSDictionary dictionaryWithObjectsAndKeys:
@"John", @"firstName" ,
@"Doe", @"lastName",
@"2013", @"memberSince", nil];
[PassSlot createPassFromTemplateWithName:@"Member Card" withValues:values
andRequestInstallation:self completion:^{
NSLog(@"PassSlot is SO EASY!");
}];
Tasks
Setting up PassSlot
Creating a pass
-
+ createPassFromTemplate:withValues:andRequestInstallation:completion:
Create a pass from a template and request the installation of the pass
-
+ createPassFromTemplateWithName:withValues:andRequestInstallation:completion:
Create a pass from a template name and request the installation of the pass
-
+ createPassFromTemplate:withValues:withImages:andRequestInstallation:completion:
Create a pass from a template and request the installation of the pass
-
+ createPassFromTemplateWithName:withValues:withImages:andRequestInstallation:completion:
Create a pass from a template name and request the installation of the pass
-
+ passFromTemplate:withValues:pass:
Create a pass from a template
-
+ passFromTemplate:withValues:withImages:pass:
Create a pass from a template
-
+ passFromTemplateWithName:withValues:pass:
Create a pass from a template name
-
+ passFromTemplateWithName:withValues:withImages:pass:
Create a pass from a template name
Modifing a pass instance
-
+ setValues:forPass:updatedPass:
Update the values of an existing pass
-
+ valuesForPass:pass:
Get the values of an existing pass
-
+ setImages:forPass:updatedPass:
Update the images of an existing pass
-
+ imagesForPass:pass:
Get the images of an existing pass
-
+ jsonForPass:pass:
Get the pass json of an existing pass
Downloading Passes
-
+ downloadPass:pass:
Download an existing pass
Adding Passes to Passbook
-
+ requestPassInstallation:inViewController:completion:
Add an existing pass to Passbook
Managing Pass Templates
-
+ listTemplates:
List all available pass templates
Error handling
-
+ setErrorHandler:
Sets the error handler
Class Methods
appKey
Gets the current app key
+ (NSString *)appKey
Return Value
Your app key
Discussion
Gets the current app key
Declared In
PassSlot.h
createPassFromTemplate:withValues:andRequestInstallation:completion:
Create a pass from a template and request the installation of the pass
+ (void)createPassFromTemplate:(PSPassTemplate *)template withValues:(NSDictionary *)values andRequestInstallation:(UIViewController *)viewController completion:(PSCompletion)completion
Parameters
- template
PassTemplate that is used to create the pass
- values
Placeholder values that will be filled in
- viewController
The UIViewController that will be used to present the PKAddPassesViewController. If the controller conforms to PKAddPassesViewControllerDelegate it is set as the delegate for the PKAddPassesViewController.
- completion
A block object to be executed when the pass was added to passbook. This block takes no parameters and has no return value.
Discussion
Create a pass from a template and request the installation of the pass
Declared In
PassSlot.h
createPassFromTemplate:withValues:withImages:andRequestInstallation:completion:
Create a pass from a template and request the installation of the pass
+ (void)createPassFromTemplate:(PSPassTemplate *)template withValues:(NSDictionary *)values withImages:(NSArray *)images andRequestInstallation:(UIViewController *)viewController completion:(PSCompletion)completion
Parameters
- template
PassTemplate that is used to create the pass
- values
Placeholder values that will be filled in
- images
Array of PSImage for the pass
- viewController
The UIViewController that will be used to present the PKAddPassesViewController. If the controller conforms to PKAddPassesViewControllerDelegate it is set as the delegate for the PKAddPassesViewController.
- completion
A block object to be executed when the pass was added to passbook. This block takes no parameters and has no return value.
Discussion
Create a pass from a template and request the installation of the pass
Declared In
PassSlot.h
createPassFromTemplateWithName:withValues:andRequestInstallation:completion:
Create a pass from a template name and request the installation of the pass
+ (void)createPassFromTemplateWithName:(NSString *)templateName withValues:(NSDictionary *)values andRequestInstallation:(UIViewController *)viewController completion:(PSCompletion)completion
Parameters
- templateName
PassTemplate that is used to create the pass
- values
Placeholder values that will be filled in
- viewController
The UIViewController that will be used to present the PKAddPassesViewController. If the controller conforms to PKAddPassesViewControllerDelegate it is set as the delegate for the PKAddPassesViewController.
- completion
A block object to be executed when the pass was added to passbook. This block takes no parameters and has no return value.
Discussion
Create a pass from a template name and request the installation of the pass
Declared In
PassSlot.h
createPassFromTemplateWithName:withValues:withImages:andRequestInstallation:completion:
Create a pass from a template name and request the installation of the pass
+ (void)createPassFromTemplateWithName:(NSString *)templateName withValues:(NSDictionary *)values withImages:(NSArray *)images andRequestInstallation:(UIViewController *)viewController completion:(PSCompletion)completion
Parameters
- templateName
PassTemplate that is used to create the pass
- values
Placeholder values that will be filled in
- images
Array of PSImage for the pass
- viewController
The UIViewController that will be used to present the PKAddPassesViewController. If the controller conforms to PKAddPassesViewControllerDelegate it is set as the delegate for the PKAddPassesViewController.
- completion
A block object to be executed when the pass was added to passbook. This block takes no parameters and has no return value.
Discussion
Create a pass from a template name and request the installation of the pass
Declared In
PassSlot.h
downloadPass:pass:
Download an existing pass
+ (void)downloadPass:(PSPass *)pass pass:(PSPassBlock)passBlock
Parameters
- pass
PSPass which should be downloaded
- passBlock
A block object to be executed when the pass file was downloaded. This block has no return value and takes a single PSPass argument with the downloaded pass file attached
Discussion
Download an existing pass
Declared In
PassSlot.h
imagesForPass:pass:
Get the images of an existing pass
+ (void)imagesForPass:(PSPass *)pass pass:(PSPassBlock)passBlock
Parameters
- pass
PSPass for which the images should be retrieved
- passBlock
A block object to be executed when the pass values were retrieved. This block has no return value and takes a single PSPass argument with the retrieved values
Discussion
Get the images of an existing pass
Declared In
PassSlot.h
jsonForPass:pass:
Get the pass json of an existing pass
+ (void)jsonForPass:(PSPass *)pass pass:(PSPassBlock)passBlock
Parameters
- pass
PSPass for which the json should be retrieved
- passBlock
A block object to be executed when the pass json was retrieved. This block has no return value and takes a single PSPass argument with the retrieved json
Discussion
Get the pass json of an existing pass
Declared In
PassSlot.h
listTemplates:
List all available pass templates
+ (void)listTemplates:(PSTemplateListBlock)templates
Parameters
- templates
A block object to be executed when the pass templates were retrieved. This block has no return value and takes a single NSArray argument containing all available PSPassTemplate
Discussion
List all available pass templates
Declared In
PassSlot.h
passFromTemplate:withValues:pass:
Create a pass from a template
+ (void)passFromTemplate:(PSPassTemplate *)template withValues:(NSDictionary *)values pass:(PSPassBlock)passBlock
Parameters
- template
PassTemplate that is used to create the pass
- values
Placeholder values that will be filled in
- passBlock
A block object to be executed when the pass was created. This block has no return value and takes a single PSPass argument which is the created pass
Discussion
Create a pass from a template
Declared In
PassSlot.h
passFromTemplate:withValues:withImages:pass:
Create a pass from a template
+ (void)passFromTemplate:(PSPassTemplate *)template withValues:(NSDictionary *)values withImages:(NSArray *)images pass:(PSPassBlock)passBlock
Parameters
- template
PassTemplate that is used to create the pass
- values
Placeholder values that will be filled in
- images
Array of PSImage for the pass
- passBlock
A block object to be executed when the pass was created. This block has no return value and takes a single PSPass argument which is the created pass
Discussion
Create a pass from a template
Declared In
PassSlot.h
passFromTemplateWithName:withValues:pass:
Create a pass from a template name
+ (void)passFromTemplateWithName:(NSString *)templateName withValues:(NSDictionary *)values pass:(PSPassBlock)passBlock
Parameters
- templateName
PassTemplate that is used to create the pass
- values
Placeholder values that will be filled in
- passBlock
A block object to be executed when the pass was created. This block has no return value and takes a single PSPass argument which is the created pass
Discussion
Create a pass from a template name
Declared In
PassSlot.h
passFromTemplateWithName:withValues:withImages:pass:
Create a pass from a template name
+ (void)passFromTemplateWithName:(NSString *)templateName withValues:(NSDictionary *)values withImages:(NSArray *)images pass:(PSPassBlock)passBlock
Parameters
- templateName
PassTemplate that is used to create the pass
- values
Placeholder values that will be filled in
- images
Array of PSImage for the pass
- passBlock
A block object to be executed when the pass was created. This block has no return value and takes a single PSPass argument which is the created pass
Discussion
Create a pass from a template name
Declared In
PassSlot.h
requestPassInstallation:inViewController:completion:
Add an existing pass to Passbook
+ (BOOL)requestPassInstallation:(PSPass *)pass inViewController:(UIViewController *)viewController completion:(PSCompletion)completion
Parameters
- pass
PSPass which should be added
- viewController
The UIViewController that will be used to present the PKAddPassesViewController. If the controller conforms to PKAddPassesViewControllerDelegate it is set as the delegate for the PKAddPassesViewController.
- completion
A block object to be executed when the pass was added to passbook. This block takes no parameters and has no return value.
Discussion
Add an existing pass to Passbook
If the pass file was not downloaded yet, this is done before adding the pass to passbook
Declared In
PassSlot.h
setErrorHandler:
Sets the error handler
+ (void)setErrorHandler:(PSErrorBlock)errorHandler
Parameters
- errorHandler
A block object that handles errors
Discussion
Sets the error handler
Declared In
PassSlot.h
setImages:forPass:updatedPass:
Update the images of an existing pass
+ (void)setImages:(NSArray *)images forPass:(PSPass *)pass updatedPass:(PSPassBlock)passBlock
Parameters
- images
NSArray of PSImage that will be used for the pass
- pass
Existing PSPass that should be updated
- passBlock
A block object to be executed when the pass was updated. This block has no return value and takes a single PSPass argument which is the updated pass
Discussion
Update the images of an existing pass
Declared In
PassSlot.h
setValues:forPass:updatedPass:
Update the values of an existing pass
+ (void)setValues:(NSDictionary *)values forPass:(PSPass *)pass updatedPass:(PSPassBlock)passBlock
Parameters
- values
Placeholder values that will be filled in
- pass
Existing PSPass that should be updated
- passBlock
A block object to be executed when the pass was updated. This block has no return value and takes a single PSPass argument which is the updated pass
Discussion
Update the values of an existing pass
Declared In
PassSlot.h
start:
Starts the PassSlot engine
+ (void)start:(NSString *)appKey
Parameters
- appKey
Your App Key
Declared In
PassSlot.h
valuesForPass:pass:
Get the values of an existing pass
+ (void)valuesForPass:(PSPass *)pass pass:(PSPassBlock)passBlock
Parameters
- pass
PSPass for which the placeholder values should be retrieved
- passBlock
A block object to be executed when the pass values were retrieved. This block has no return value and takes a single PSPass argument with the retrieved values
Discussion
Get the values of an existing pass
Declared In
PassSlot.h