iOS 6 Passbook:从我的应用程序打开Passbook应用程序 [英] iOS 6 Passbook: Open Passbook app from my app
问题描述
我正在构建与Passbook应用程序相关的应用程序。基本上我正在为机票生成登机牌并将其添加到Passbook。那部分工作正常。但是,我想从我的应用程序中打开Passbook应用程序以查看通行证详细信息。
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.
我看到Apple已删除了URL方案选项。我怎样才能实现这个目标?
I have seen that Apple has removed the URL scheme options. How can I achieve this?
推荐答案
我遇到了同样的问题,它在模拟器上工作得很好但在设备上崩溃了。
1 - 仔细检查权利
2 - 当_pass已经在库中时我使用了这个:
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]]];
我希望它有所帮助。
这篇关于iOS 6 Passbook:从我的应用程序打开Passbook应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!