我有一个应用程序需要使用自定义URL方案打开另一个应用程序。我可以找到我需要以某种方式打开的应用程序的版本号吗?

时间:2022-07-14 19:37:51

I have an app that needs to open another app using a custom URL scheme. Can I find out the version number of the app I need to open somehow?

我有一个应用程序需要使用自定义URL方案打开另一个应用程序。我可以找到我需要以某种方式打开的应用程序的版本号吗?

The company who made the app has changed their URL scheme and so the one I am calling requires version 2.7 of their app. Is there any way to detect which version of the app the user has installed, and then prompt them to update the app (before we call into it) if the version number is too low (< 2.7 in this case)?

制作应用程序的公司已经更改了他们的URL方案,因此我调用的应用程序需要2.7版本的应用程序。有没有办法检测用户安装了哪个版本的应用程序,然后提示他们更新应用程序(在我们调用之前)如果版本号太低(在这种情况下<2.7)?

Thanks

谢谢

1 个解决方案

#1


1  

You should use UIApplication -(BOOL)canOpenURL:(NSURL *)url to see if the URL scheme you are using is supported or not. You can then proceed to test for the second scheme and so on.

您应该使用UIApplication - (BOOL)canOpenURL:(NSURL *)url来查看您使用的URL方案是否受支持。然后,您可以继续测试第二个方案,依此类推。

#1


1  

You should use UIApplication -(BOOL)canOpenURL:(NSURL *)url to see if the URL scheme you are using is supported or not. You can then proceed to test for the second scheme and so on.

您应该使用UIApplication - (BOOL)canOpenURL:(NSURL *)url来查看您使用的URL方案是否受支持。然后,您可以继续测试第二个方案,依此类推。