pub struct Pass {
pub template: Template,
/* private fields */
}Expand description
Represents an complete pass with reference to a directory with image and resource files
Fields§
§template: TemplateReference to the Template instance
Implementations§
Source§impl Pass
impl Pass
Sourcepub fn from_path<P: AsRef<Path>>(pass_path: P) -> Result<Self>
pub fn from_path<P: AsRef<Path>>(pass_path: P) -> Result<Self>
Parse a Pass instance from the given directory
Sourcepub fn from_template<P: AsRef<Path>>(template: &Template, pass_path: P) -> Self
pub fn from_template<P: AsRef<Path>>(template: &Template, pass_path: P) -> Self
Create a Pass instance from the given Template and an reference to a directory with image and resource files
Methods from Deref<Target = Template>§
Sourcepub fn app_launch_url(&mut self, app_launch_url: &str)
pub fn app_launch_url(&mut self, app_launch_url: &str)
A URL to be passed to the associated app when launching it. The app receives this URL in the application:didFinishLaunchingWithOptions: and application:openURL:options: methods of its app delegate.
Sourcepub fn add_associated_store_identifiers(
&mut self,
associated_store_identifier: f64,
)
pub fn add_associated_store_identifiers( &mut self, associated_store_identifier: f64, )
A list of iTunes Store item identifiers for the associated apps. Only one item in the list is used—the first item identifier for an app compatible with the current device. If the app is not installed, the link opens the App Store and shows the app. If the app is already installed, the link launches the app.
Sourcepub fn clear_associated_store_identifiers(&mut self)
pub fn clear_associated_store_identifiers(&mut self)
A list of iTunes Store item identifiers for the associated apps. Only one item in the list is used—the first item identifier for an app compatible with the current device. If the app is not installed, the link opens the App Store and shows the app. If the app is already installed, the link launches the app.
Sourcepub fn authentication_token(&mut self, authentication_token: &str)
pub fn authentication_token(&mut self, authentication_token: &str)
The authentication token to use with the web service.
Sourcepub fn background_color(&mut self, background_color: &str)
pub fn background_color(&mut self, background_color: &str)
Background color of the pass, specified as an CSS-style RGB triple.
Sourcepub fn barcode(&mut self, barcode: Barcode)
pub fn barcode(&mut self, barcode: Barcode)
Information specific to the pass’s barcode. Deprecated in iOS 9.0 and later; use barcodes instead.
Sourcepub fn add_barcodes(&mut self, barcode: Barcode)
pub fn add_barcodes(&mut self, barcode: Barcode)
Information specific to the pass’s barcode. The system uses the first valid barcode dictionary in the array. Additional dictionaries can be added as fallbacks. Available only in iOS 9.0 and later.
Sourcepub fn clear_barcodes(&mut self)
pub fn clear_barcodes(&mut self)
Information specific to the pass’s barcode. The system uses the first valid barcode dictionary in the array. Additional dictionaries can be added as fallbacks. Available only in iOS 9.0 and later.
Sourcepub fn add_beacon(&mut self, beacon: Beacon)
pub fn add_beacon(&mut self, beacon: Beacon)
Beacons marking locations where the pass is relevant. Available in iOS 7.0.
Sourcepub fn clear_beacons(&mut self)
pub fn clear_beacons(&mut self)
Beacons marking locations where the pass is relevant. Available in iOS 7.0.
Sourcepub fn boarding_pass(&mut self, boarding_pass: BoardingPass)
pub fn boarding_pass(&mut self, boarding_pass: BoardingPass)
Information specific to a boarding pass.
Sourcepub fn description(&mut self, description: &str)
pub fn description(&mut self, description: &str)
Brief description of the pass, used by the iOS accessibility technologies. Don’t try to include all of the data on the pass in its description, just include enough detail to distinguish passes of the same type. Localizable.
Sourcepub fn event_ticket(&mut self, event_ticket: Details)
pub fn event_ticket(&mut self, event_ticket: Details)
Information specific to an event ticket.
Sourcepub fn expiration_date(&mut self, expiration_date: &str)
pub fn expiration_date(&mut self, expiration_date: &str)
Date and time when the pass expires. Available in iOS 7.0.
Sourcepub fn foreground_color(&mut self, foreground_color: &str)
pub fn foreground_color(&mut self, foreground_color: &str)
Foreground color of the pass, specified as a CSS-style RGB triple
Sourcepub fn format_version(&mut self, format_version: Value)
pub fn format_version(&mut self, format_version: Value)
Version of the file format.
Sourcepub fn grouping_identifier(&mut self, grouping_identifier: &str)
pub fn grouping_identifier(&mut self, grouping_identifier: &str)
Identifier used to group related passes. If a grouping identifier is specified, passes with the same style, pass type identifier, and grouping identifier are displayed as a group. Otherwise, passes are grouped automatically. Use this to group passes that are tightly related, such as the boarding passes for different connections of the same trip. Available in iOS 7.0.
Sourcepub fn label_color(&mut self, label_color: &str)
pub fn label_color(&mut self, label_color: &str)
olor of the label text, specified as a CSS-style RGB triple. If omitted, the label color is determined automatically.
Sourcepub fn add_location(&mut self, location: Location)
pub fn add_location(&mut self, location: Location)
Locations where the pass is relevant. For example, the location of your store.
Sourcepub fn clear_locations(&mut self)
pub fn clear_locations(&mut self)
Locations where the pass is relevant. For example, the location of your store.
Sourcepub fn logo_text(&mut self, logo_text: &str)
pub fn logo_text(&mut self, logo_text: &str)
Text displayed next to the logo on the pass. Localizable.
Sourcepub fn max_distance(&mut self, max_distance: f64)
pub fn max_distance(&mut self, max_distance: f64)
Maximum distance in meters from a relevant latitude and longitude that the pass is relevant. This number is compared to the pass’s default distance and the smaller value is used. Available in iOS 7.0.
Sourcepub fn nfc(&mut self, nfc: Nfc)
pub fn nfc(&mut self, nfc: Nfc)
Information used for Value Added Service Protocol transactions. Available in iOS 9.0.
Sourcepub fn organization_name(&mut self, organization_name: &str)
pub fn organization_name(&mut self, organization_name: &str)
Display name of the organization that originated and signed the pass. Localizable.
Sourcepub fn pass_type_identifier(&mut self, pass_type_identifier: &str)
pub fn pass_type_identifier(&mut self, pass_type_identifier: &str)
Pass type identifier, as issued by Apple. The value must correspond with your signing certificate.
Sourcepub fn relevant_date(&mut self, relevant_date: &str)
pub fn relevant_date(&mut self, relevant_date: &str)
Date and time when the pass becomes relevant. For example, the start time of a movie. Recommended for event tickets and boarding passes.
Sourcepub fn serial_number(&mut self, serial_number: &str)
pub fn serial_number(&mut self, serial_number: &str)
Serial number that uniquely identifies the pass. No two passes with the same pass type identifier may have the same serial number.
Sourcepub fn store_card(&mut self, store_card: Details)
pub fn store_card(&mut self, store_card: Details)
Information specific to a store card.
Sourcepub fn suppress_strip_shine(&mut self, suppress_strip_shine: bool)
pub fn suppress_strip_shine(&mut self, suppress_strip_shine: bool)
If true, the strip image is displayed without a shine effect. The default value prior to iOS 7.0 is false. In iOS 7.0, a shine effect is never applied, and this key is deprecated.
Sourcepub fn team_identifier(&mut self, team_identifier: &str)
pub fn team_identifier(&mut self, team_identifier: &str)
Team identifier of the organization that originated and signed the pass, as issued by Apple.
Sourcepub fn add_user_info(&mut self, key: &str, value: Value)
pub fn add_user_info(&mut self, key: &str, value: Value)
Custom information for companion apps. This data is not displayed to the user. For example, a pass for a cafe could include information about the user’s favorite drink and sandwich in a machine-readable form for the companion app to read, making it easy to place an order for “the usual” from the app. Available in iOS 7.0.
Sourcepub fn clear_user_info(&mut self)
pub fn clear_user_info(&mut self)
Custom information for companion apps. This data is not displayed to the user. For example, a pass for a cafe could include information about the user’s favorite drink and sandwich in a machine-readable form for the companion app to read, making it easy to place an order for “the usual” from the app. Available in iOS 7.0.
Sourcepub fn voided(&mut self, voided: bool)
pub fn voided(&mut self, voided: bool)
Indicates that the pass is void—for example, a one time use coupon that has been redeemed. Available in iOS 7.0.
Sourcepub fn web_service_url(&mut self, web_service_url: &str)
pub fn web_service_url(&mut self, web_service_url: &str)
The URL of a web service that conforms to the API described in PassKit Web Service Reference. The web service must use the HTTPS protocol; the leading https:// is included in the value of this key. On devices configured for development, there is UI in Settings to allow HTTP web services.