作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经筛选了关于未调用 openURL 的各种其他帖子,但没有一个适用于我的情况,所以这里是另一个。
我正在尝试实现深层链接。我可以从链接打开应用程序,所以我的 url 方案有效。但是,永远不会调用 openURL 方法。
我使用的是 iOS 8。
如果我删除 MainWindow.xib,我会得到一个黑屏(还没有整理出在其中编程的细节),但是 openURL 方法会在它应该调用的时候被调用。
我的公司不完全是该项目的所有者,因此理想情况下,应该有一种方法可以使 openURL 与 MainWindow.xib 一起使用,或者显示一些说明不支持此功能的文档。
代码:在我的 applicationdelegate.m 中:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
NSLog(@"open %@",url);
return YES;
}
在 info.plist 中:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>com.something.appish</string>
<key>CFBundleURLSchemes</key>
<array>
<string>schemename</string>
</array>
<key>CFBundleURLTypes</key>
<string>Viewer</string>
</dict>
</array>
我使用的链接是 schemename://anything 和 com.something.appish://anything
这些打开我的应用程序或将其带到最前沿,但不会导致 openURL 调用。
关于该主题的先前帖子包括:
最佳答案
事实证明,一个静态库(我可以访问它的源代码)混淆了 openURL。
谢谢!
关于ios - 应用程序 :openURL:sourceApplication:annotation: not called when there is a MainWindow. xib,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32210639/
我是一名优秀的程序员,十分优秀!