简体   繁体   English

我可以将iOS应用启动到特定位置吗?

[英]Can I launch an iOS app to a specific location?

I have a website and an app. 我有一个网站和一个应用程序。 The website hosts tests (eg - online school tests). 该网站托管测试(例如-在线学校测试)。

Since some of the tests require audio / microphone / video recording capability, I have to create an iOS app to leverage the devices capabilities (they aren't all available via a mobile browser). 由于某些测试需要音频/麦克风/视频录制功能,因此我必须创建一个iOS应用来利用设备功能(通过移动浏览器无法全部使用)。

So, I've created an app that allows users to login using their website credentials and navigate to there tests (a folder structure). 因此,我创建了一个应用程序,允许用户使用其网站凭据登录并导航到其中的测试(文件夹结构)。 They can choose the test, run it, and voila! 他们可以选择测试,运行它,然后瞧!

However, I want to add a new user flow that enables a user who is on the website (via mobile browser) to launch into the app at the correct location. 但是,我想添加一个新的用户流,使网站(通过移动浏览器)上的用户能够在正确的位置启动应用程序。 Eg the app launches straight to that specific test - rather than needing to go through the navigation part. 例如,应用程序直接针对该特定测试启动-而不需要通过导航部分。 Is there a way of doing this? 有办法吗?

I should also note that the location will be dynamic (eg each test will have an ID, and new tests will be added all the time) 我还应注意,该位置将是动态的(例如,每个测试将具有一个ID,并且将一直添加新的测试)

Cheers, Ollie 干杯,奥利

URL Schemes aka Deep Links URL方案又称为深层链接

What you're looking for is URL Schemes . 您正在寻找的是URL Schemes They are sometimes called Deep Links . 它们有时称为“ 深层链接”

A URL scheme lets you communicate with other apps through a protocol that you define. URL方案使您可以通过定义的协议与其他应用程序进行通信。 To communicate with an app that implements such a scheme, you must create an appropriately formatted URL and ask the system to open it. 要与实现此类方案的应用进行通信,您必须创建格式正确的URL并要求系统将其打开。 To implement support for a custom scheme, you must declare support for the scheme and handle incoming URLs that use the scheme. 要实现对自定义方案的支持,必须声明对方案的支持并处理使用该方案的传入URLs

Using URL schemes your app can be opened from websites or emails. 使用URL方案可以从网站或电子邮件中打开您的应用程序。 You can also pass arguments in the URL . 您也可以在URL传递参数。 Then, use these arguments to navigate user to specific points in your app. 然后,使用这些参数将用户导航到应用程序中的特定点。

Now, that you know what to use, look for some tutorials. 现在,您知道要使用什么,请寻找一些教程。 Here is one , or another one here . 这里是一个或另一个在这里一个

Yes, this is possible. 是的,这是可能的。 You must register an url scheme for your app and implement application: didOpenUrl: in your AppDelegate. 您必须为您的应用程序注册一个URL方案并在AppDelegate中实现应用程序:didOpenUrl:。

See here: Using URL Schemes to Communicate with Apps 请参阅此处: 使用URL方案与应用进行通信

You can launch your application using custom URL scheme . 您可以使用自定义URL方案启动应用程序。

Here you can pass additional data from mobile browser in form of URL which your iOS native application will receive. 您可以在此处以iOS本机应用程序将收到的URL形式从移动浏览器传递其他数据。 Based on data you are receiving, you can take appropriate decision. 根据收到的数据,您可以做出适当的决定。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM