iOS 6 Passbook: Open Passbook app from my app

谁说我不能喝 提交于 2019-11-30 07:57:30

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!