3

I am building an application related to the Passbook app. Basically I am generating a boarding pass for a flight ticket and adding it to Passbook. That part is working fine. But, I want to open the Passbook app from my app to see the pass details.

I have seen that Apple has removed the URL scheme options. How can I achieve this?

Sam Spencer
  • 8,492
  • 12
  • 76
  • 133
vinay
  • 1,276
  • 3
  • 20
  • 34

1 Answers1

7

I had the same problem, it worked well with the emulator but crashed on the device. 1 - Double check the Entitlements 2 - I used this when the _pass is already in the library:

if([_passLibrary containsPass:_pass])
{
    [[UIApplication sharedApplication] openURL:[[_passLibrary passWithPassTypeIdentifier:[_pass passTypeIdentifier] serialNumber:[_pass serialNumber]] passURL]];        
}

Use the same context to delete the pass too:

[_passLibrary removePass: [_passLibrary passWithPassTypeIdentifier:[_pass passTypeIdentifier] serialNumber:[_pass serialNumber]]];

I hope it helps.

Dávid Kaszás
  • 1,877
  • 1
  • 16
  • 20
  • 1
    The answer posed seems to fail when the passes get grouped together and you have to swipe to go from one to the other. In this case openURL opens up the pass group and chooses one of them to show (whether or not it's the actual pass requested). Is there a way to fix this issue? – fjlksahfob Oct 23 '12 at 19:53
  • 1
    I filled a bug report about it and I will let you know if something happens. – Dávid Kaszás Oct 25 '12 at 07:17
  • I have the same issue as John Dota - I have a list of passes in my app with a "view in passbook" button for each and I want to be able to jump that particular pass in my group in Passbook when the user taps on the "view in passbook" button. – RPM Nov 15 '12 at 06:18
  • Share rdar number, so when submitting it the bug again and reference your ticket - this way bugs can gets fixed sooner by Apple. – matm Dec 07 '12 at 12:35