使用PKPassLibrary类的pass方法获取您的应用有权访问的所有传递。通过以任意顺序返回。
PKPassLibrary *passLib = [[PKPassLibrary alloc] init];
NSArray *passArray = [passLib passes];
if ([passArray count] > 0)
{
PKPass *lastPassAdded = [passArray objectAtIndex:0];
NSLog(@"Pass Localized Name: %@",[lastPassAdded localizedName]);
NSLog(@"Pass Organization Name: %@", [lastPassAdded organizationName]);
NSLog(@"passTypeIdentifier = %@", [lastPassAdded passTypeIdentifier]);
NSLog(@"passSerial Number = %@",[lastPassAdded serialNumber]);
[[UIApplication sharedApplication] openURL:[[passLib passWithPassTypeIdentifier:[lastPassAdded passTypeIdentifier] serialNumber:[lastPassAdded serialNumber]] passURL]];
}
在我的代码中,我可以获得所有优惠券,但不知道是否有表格按存折的包含日期排序