Wayne Conn3cted
Wayne Conn3cted

Reputation: 41

Can retrieve pass from PassBook ok on Simulator but not on iOS device

I've hit an issue that I just cannot solve. We have an app that can store cards, these cards can be added to the passbook on iOS. We have no problems with this. However when we need to update the card in the passbook we cannot retrieve the card from the passbook - we always get nil returned. However on the simulator it always works.

This is how I am calling

_passLib = [[PKPassLibrary alloc] init];
NSString* serialId = [[NSString alloc] initWithFormat:@"%@", card.serialId];
PKPass *oldPass = [_passLib passWithPassTypeIdentifier:@"pass.com.mydomain.iphone.Product" serialNumber:serialId];

The identifier and serial id are 100% correct. When adding the card I output these values to double check they are the same as above. Has anyone had this or has some ideas that can help me solve this? many thanks

Edit 1 Just to add. If I try and add the pass again - the PKAddPassesViewController displays the new pass but the 'Add' button is greyed out because we already have the pass added. So its like it knows its there, but the methods containsPass and passWithPassTypeIdentifier both fail..

Upvotes: 2

Views: 1205

Answers (1)

Wayne Conn3cted
Wayne Conn3cted

Reputation: 41

Ok finally figured it out. I needed to configure my App Id in the development center and enable 'passes'. I then have to generate a new provisioning profile and use that.

Upvotes: 2

Related Questions