How to reliably determine whether Passbook is available?

927 views Asked by At

Apple provides a dedicated method in Passkit to determine whether the PassLibrary is available:

[PKPassLibrary isPassLibraryAvailable]

This works as expected on iPhone and iPad with one exception: The iPad Air 2 returns YES but it seems that it does not support any UI to add a pass. Invocation of

[[PKAddPassesViewController alloc] initWithPass:aValidPass]

returns nil.

Is there any option to check reliably whether PassLibrary, including UI, is available WITHOUT having a pass beforehand?

1

There are 1 answers

0
DEAD10CC On BEST ANSWER

From isPassLibraryAvailable

Do not use this method to determine whether the user can add passes on this device. A device may have a pass library, but still not be able to add passes. Use the PKAddPassesViewController class’s canAddPasses() method instead.

You should use PKAddPassesViewController for this, which returns whether the device supports adding passes.

[PKAddPassesViewController canAddPasses]

since iOS8