- От веба до приложения за один DeepLink
- OneLink
- DynamicLink
- Выводы
- WebLink® Frequently Asked Questions
- This FAQ provides answers to the most frequently asked questions by the WebLink community.
- Q1. What is WebLink?
- Q2. How can I find what applications are compatible with my car radio?
- Q3. How do I discover if my car radio is WebLink compatible?
- Q4. What phones are supported by WebLink?
- Q5. Why don’t I have access to a certain app?
- Q6. I have a certified WebLink car radio and a supported smartphone, but WebLink won’t launch when the phone is connected to the car radio. How can I use WebLink?
- Q7. How do I add more WebLink compatible apps?
- Q8. I only see a black screen on my car radio when I launch WebLink on my phone. How can I get apps to show up properly?
- Q9. The WebLink Weather app won’t show me weather information?
- Q10. When I launch the Music Player application, why don’t my music tracks show up in the search results?
- Q11. When I launch the Video Player application, why don’t my video tracks show up in the search results?
- Q12. Why won’t my smartphone establish a connection with the headunit?
- Q13. How do I change the language in WebLink?
- Q14. My WebLink headunit supports WebLink Cast. What version of iOS and Android is supported?
От веба до приложения за один DeepLink
Android-приложения являются отражением сайта или сервиса и зачастую представляют собой сходный функционал в удобной оболочке. Из-за этого становится насущным вопрос навигации между страничкой в вебе и установленным клиентом. Для решения этой проблемы были изобретены диплинки (deeplink). Под катом вас ждёт увлекательная история о том, как мы внедряли их у себя и обрабатывали случай, когда у пользователя ещё не было установлено наше приложение.
Диплинки были придуманы так давно, что сейчас уже сложно представить приложение без них. Сама по себе технология не требует свежего Android API, однако если допиливать App Indexing, то можно столкнуться с тем, что работает оно с API 17.
Вернёмся к диплинкам. Их конфигурация представляет собой набор настроек для intent-filter в манифесте приложения, которые описывают паттерны поддерживаемых ссылок.
После этих нехитрых манипуляций при каждом нажатии на ссылку, удовлетворяющую настройкам фильтра, пользователю предлагается выбор между несколькими приложениями, в том числе и вашим. Далее активити, для которой мы задали intent-filter, получит Intent, содержащий в себе линк. Если достать его методом Intent#getData и распарсить необходимые параметры, то можно направить пользователя сразу в интересующий раздел.
После реализации может возникнуть вполне резонный вопрос: что делать, если у пользователя ещё нет приложения? Ответом будут особые диплинки, которые в этом случае умеют направлять человека в Маркет. При должном усердии такую ссылку можно генерировать самим, но нет никаких гарантий, что она будет работать со всеми браузерами и на всех версиях Android. Сейчас довольно много сервисов, предлагающих решение по крайней мере части этих проблем, например, AppsFlyer с их OneLink или Firebase с DynamicLink. Все они работают примерно одинаково, только DynamicLink использует для обработки диплинков предустановленные сервисы Google.
OneLink
Сам по себе OneLink ведёт на серверы AppsFlyer; они определяют, с какого устройства пользователь вышел в сеть, и перенаправляют его на соответствующий адрес. Можно задать редиректы для десктопа, Android и iOS. Когда Android-приложение установлено, линк прилетает в него через Intent как обычный диплинк. Когда приложения нет, в работу вступают Google Chrome и Google Play.
Наличие приложения проверяется браузером. У Chrome есть спецификация особого формата ссылок, которые потом конвертируются им в Intent и отправляются в систему. Она предусматривает задание ссылки на Google Play в случае, если приложение не установлено. Подробнее с ней можно ознакомиться тут.
Вообще в Google Play можно передать ссылку на приложение таким образом, чтобы после установки и запуска он прокинул часть её дальше. Это реализуется с помощью query-параметра url и будет выглядеть примерно так:
В этом случае best.memes/jokes попадёт внутрь приложения после его установки в виде диплинка. По умолчанию AppsFlyer работает не так: он предлагает получить ссылку через интерфейс библиотеки. Сам диплинк при этом, видимо, передаётся в приложение через серверы сервиса.
Это очень неудобно, потому что, во-первых, мы не можем понять наверняка, надо ли нам ждать какие-то параметры или пользователь просто тыкнул в иконку и параметров не будет. Во-вторых, мы хотим сразу открывать нужный раздел приложения, без лишних блокировок и ожиданий. AppsFlyer же предлагает открывать главный экран, а когда пришли (и если пришли) параметры, то редиректить. Нас такой подход не устроил, поэтому мы сгенерировали свой url в Google Play с параметром для случая, когда пользователь переходит по диплинку с Android-устройства и у него нет приложения. Его мы задали в Onelink, чтобы получать диплинк в приложении без необходимости дожидаться библиотеку.
OneLink работал отлично, пока мы не попробовали пошарить его в Slack. Дело в том, что он открывает ссылки в своём встроенном браузере через Chrome Custom Tabs. Если коротко, то это вкладка браузера, которая открывается в процессе вашего приложения и может быть кастомизирована, чтобы не выбиваться из общего стиля (подробнее можно почитать тут). В этом случае откроется веб-версия Google Play и диплинк в приложение после установки проброшен не будет. Аналогично браузер ведёт себя, если руками скопировать OneLink в адресную строку и перейти по ссылке. Об этом случае разработчики Chrome писали в Release Notes несколько версий назад. Суть в том, что при таком подходе в браузере не срабатывает редирект в Google Play, когда приложение не установлено, и пользователь остаётся в вебе. Силами OneLink побороть это поведение не удалось, поэтому мы обратились к DynamicLink.
DynamicLink
Глубокая интеграция Google Play Services в систему позволяет им оптимизировать проверку наличия целевого приложения на устройстве. Это довольно закрытая экосистема, поэтому досконально разобраться в принципах её работы не удалось, однако всё указывает на то, что Chrome открывает активити с прогрессом, принадлежащую Google Play Services, которая определяет, как ей поступить с диплинком. После этого либо происходит редирект либо в Google Play, либо в приложение. При этом диплинк потом попадает в приложение через Intent, то есть без дополнительных библиотечных костылей.
Субъективно, такой подход функционирует не быстрее, чем OneLink, однако он работает при открытии ссылки в Chrome Custom Tabs, что является существенным преимуществом, потому что их используют многие приложения.
Кроме прочего, Firebase позволяет посмотреть схему работы ссылки и куда редиректится пользователь на каждой платформе в каждом случае. Выглядит это примерно так:
Выводы
OneLink. Целевое приложение установлено | OneLink. Целевое приложение НЕ установлено | DynamicLink. Целевое приложение установлено | DynamicLink. Целевое приложение НЕ установлено | |
---|---|---|---|---|
Ссылка открывается системой (ACTION_VIEW) | + | Пришлось «закостылить», чтобы получать диплинк сразу на старте | + | + |
Ссылка открывается в Chrome Custom Tabs | — | — | + | + |
По ссылке нажимают в браузере | + | Пришлось «закостылить», чтобы получать диплинк сразу на старте | + | + |
Ссылку копируют в адресную строку | — | — | + | + |
Из таблицы видно, что в реализации с DynamicLinks всё работает без костылей и во всех интересных нам случаях.
Источник
WebLink® Frequently Asked Questions
This FAQ provides answers to the most frequently asked questions by the WebLink community.
Q1. What is WebLink?
WebLink is a next generation application delivery platform for in-vehicle infotainment. It leverages the power of the phone to deliver driver relevant applications to the in-vehicle displays (car radios) in a safe manner. WebLink enabled applications run on the smartphone and are «projected» to the in-vehicle systems.
Q2. How can I find what applications are compatible with my car radio?
Download the WebLink Host application from the app store onto your smartphone (Apple App Store or Google Play Store) and connect your phone to a compatible WebLink car radio.
Once the connection between the phone and car radio is established, the car radio will pass it’s identity to WebLink and the corresponding apps will be displayed in the «Apps» tab of the WebLink Host application which is available when the phone is not connected to a car radio. When the WebLink Host app is launched and connected to the car radio, the WebLink home screen on the car radio will show the compatible app icons.
App compatibility may vary by car radio.
Q3. How do I discover if my car radio is WebLink compatible?
Look for a WebLink certified logo on your product’s packaging or in the owner’s manual of your vehicle. If your understanding is that you have a compatible WebLink car radio, connect your phone to the car radio via the correct USB connection as described in the car radio manufacturer and launch the WebLink Host application on your phone. If the car radio is compatible, the WebLink connection should be established and the phone screen and car radio should indicated that WebLink is started.
Q4. What phones are supported by WebLink?
iPhones with iOS version 13.0 and above are supported by WebLink.
Android phones with Android version 7.0 and above are supported. Please note that a minimunm requirement is that the Andorid phone must be certified by Android in order to have compatibility with WebLink. Note that not all Android certified phones may be compatible with WebLink. For a list of Android certified phones, please visit the following website.
In addition to being an Android Certified phone, the phone must meet the following minimum hardware requirements:
Smartphone must have a hardware video decoder
Minimum Smartphone CPU: 1.5GHz Dual Core
Minimum Smartphone RAM: 2GB
Q5. Why don’t I have access to a certain app?
Each car radio has a unique set of applications which are defined by the car radio manufacturer. It is possible that new applications will become available to you at a later time. If you have any suggestions on specific apps you’d like to see compatible with WebLink, please send us a message.
Q6. I have a certified WebLink car radio and a supported smartphone, but WebLink won’t launch when the phone is connected to the car radio. How can I use WebLink?
We suggest following these steps:
- Start by reading the owners manual supplied by the car radio or car manufacturer of your WebLink compatible unit.
- Ensure you have downloaded the WebLink Host application on your smartphone.
- If it’s the first time you’ve launched the application, please be sure to read and accept the WebLink Host app terms of use prior to connecting to the car radio.
- Connect your iPhone or Android device to the car radio using a certified USB cable. Be sure to connect the the phone to the correct USB input as described by youre WebLink compatible car radio/car manufacturer’s owners manual.
- Some car radios may require you to adjust the settings in their menu to enable WebLink. Be sure the WebLink settings are enabled on the car radio as described in your owners manual.
- Make sure your phone is unlocked when connecting to the car radio. For security purposes, the apps will not project onto the car radio if the phone screen is locked.
Q7. How do I add more WebLink compatible apps?
Each car radio manufacturer decides what applications are compatible with their car radios. Abalta and our customers area always looking for applications which are of interest to drivers.
If you have any suggestions on what apps you would like to see compatible with WebLink, please email us at weblink_support@abaltatech.com.
Q8. I only see a black screen on my car radio when I launch WebLink on my phone. How can I get apps to show up properly?
- Confirm that you have a WebLink compatible car radio.
- Make sure you have the correct WebLink Host application downloaded from the app store and installed on your phone.
- Launch the WebLink Host app on your phone and connect your phone via USB to the correct USB port described by your car radio manufacturer.
Note: Be sure to use an authorized and certified USB cable as often 3rd party cables are not suitable for use with WebLink.
Q9. The WebLink Weather app won’t show me weather information?
Be sure to give WebLink access to your location so that it can provide you with weather data around your location. Check the permission settings of your phone to grant WebLink access.
Q10. When I launch the Music Player application, why don’t my music tracks show up in the search results?
Be sure to give WebLink access to your Media so that it can access your music content from your phone. Check the permission settings of your phone to grant WebLink access.
Q11. When I launch the Video Player application, why don’t my video tracks show up in the search results?
Be sure to give WebLink access to your Camera Roll so that it can access your video content from your phone. Check the permission settings of your phone to grant WebLink access.
Q12. Why won’t my smartphone establish a connection with the headunit?
Please see below for common connection troubleshooting tips:
- Confirm that the head unit that you are connecting to is compatible with WebLink. Refer to your head unit or automobile’s owners manual for compatibility and/or directions to establish initial connection.
- Ensure that you have downloaded the WebLink Host application on your smartphone.
- If this is the first time that you have launched the application, please be sure to read and accept the WebLink Host app “Terms of Use” prior to connecting to the car radio.
- Ensure that you are using an official USB cable from the smartphone or head unit manufacturer. Third party cables are not always capable of video projection.
- Ensure that the USB cable is connected to the correct USB port on the head unit. Some head units require that your cable be connected to a specific USB port.
- Do not use frayed or damaged USB cables. This might result in increased data loss that prevents the establishment of a WebLink connection.
- Ensure that you are not using a USB hub or extender between the phone and head unit.
- Some car radios may require that you adjust the settings in the menu to enable WebLink. Be sure that the WebLink settings are enabled on your car radio as described in your owner’s manual.
- Make sure that your phone is unlocked when connecting to the car radio. For security purposes, the apps will not project on to the head unit if the phone screen is locked.
You can also try a Force Stop of the WebLink App and try connecting again. (Settings -> Apps -> WebLink -> Force Stop)
If you have adhered to each of the above guidelines and are still experiencing an issue, please email us at weblink_support@abaltatech.com with the following information:
- HeadUnit Model
- Phone Model
- Phone Operating System version
- WebLink Host App version
- Messaging that displays on both the Phone and Headunit when attempting to connect
- Method used to connect the phone to the headunit: Bluetooth, WiFi or USB cable
- Any additional information that may help to troubleshoot your issue, including exact steps to replicate the problem and/or video or screenshots if possible.
- It also helps to know if you have ever had a successful connection in the past.
Q13. How do I change the language in WebLink?
WebLink uses the language which you have set on your smartphone. To change the language, please go to the settings on your smartphone and change the language to your preferred language. If WebLink does not support the language which your phone is set to, it will default to English.
Q14. My WebLink headunit supports WebLink Cast. What version of iOS and Android is supported?
WebLink Cast requires Android 7.0+ and iOS 13+.
Touch control for WebLink Cast with iOS version 13.4 and above requires the WebLink Host app version 2.5.1 from the Apple App Store and the WebLink Client SDK version 2.5.1 on your headunit.
You can confirm the WebLink Host app version by checking the version number in the Apple App Store and ensuring that you have installed 2.5.1 or later version.
Some headunits may require a firmware update to include support for the WebLink Client SDK version 2.5.1. If your headunit currently does not support touch control with iOS 13.4 or above, please contact your headunit manufacturer for availability.
For iOS, please also ensure that the AssistiveTouch setting in the iPhone is set to ON and the «Perform Touch Gestures» settings is set to ON and the «Dwell Control» settings is set to OFF. On your iPhone visit Settings -> Accessibility -> Touch -> AssistiveTouch (ON) -> Performance Touch Gesture (ON) -> Dwell Control (OFF).
Источник