使用包标识符打开应用程序
是否可以使用捆绑包标识符
从我们的应用程序中打开应用程序。假设我在一台设备上安装了两个应用,分别是 com.test.app1
和 com.test.app2
。我可以从我的 app2 中打开 app1 吗?
我知道 openUrl 方法。为此,我必须在 info.plist 中注册 url 方案。然后我可以使用以下方法:
[[UIApplication sharedApplication] openUrl:[NSURL urlWithString:@"myApp1://"]];
但是如果我没有注册 url 方案或者不知道注册的 url 怎么办?
有什么想法吗..?
Is it possible to open a application from our application with bundle identifier
. Suppose I have two apps installed on device one with com.test.app1
and com.test.app2
. Can I open app1 from my app2.
I know about openUrl method. for that I have to register url scheme in info.plist. and then i can use following method:
[[UIApplication sharedApplication] openUrl:[NSURL urlWithString:@"myApp1://"]];
But what if I didn't register url scheme or don't know the registered url.
Any idea..?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您可以使用私有 API 来做到这一点
You can use private API to do that
@EvanJIANG 答案的 Swift 版本。
The Swift version of @EvanJIANG answer.
我认为这是不可能的。
I don't think that's possible.
您可以使用
openUrl
调用,但为了成功,您必须向项目的xy-Info.plist
文件添加一些值。完成后,您可以调用:
[[UIApplication sharedApplication] openUrl:[ NSURL urlWithString:@"xingipad://"]];
You can use the
openUrl
call, but in order to succeed you must add some values to your project'sxy-Info.plist
file.Once you've done that you can then call:
[[UIApplication sharedApplication] openUrl:[NSURL urlWithString:@"xingipad://"]];
答:仅使用Bundle 标识符无法直接打开应用程序。
解决方案:您可以实现深度链接(并将您的捆绑ID作为深度链接ID)概念来执行此操作:深度链接
Answer: You can't open app directly only with Bundle identifier.
Solution: You can implement deep linking (and take your bundle id as your deep linking id)concept to do this: Deep-linking
可以使用 URL 方案。
It is possible using URL Schemes .