Override certain URLs to launch an app or intent scheme #1344
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes: #569
We now accept
app://
andintent://
prefix. When testing in a desktop a blank tab opens so nothing harmful appears to happen elsewhere.When we detect that a link starts with
app://
we will grab the android package and attempt to launch it, if the package does not exist we take the user to the play store (app or website)When we detect the link starts with
intent://
we will parse the Uri with the intent scheme and attempt to launch the activity, if the app is not found we will also take the user to the play store (app or website)Examples using lovelace weblink entity card type:
This example will launch Twitter if it is installed on the device, otherwise it will open the Google Play store app or website.
This example will launch the barcode scanning app ready to scan via the Intent scheme, if the app is not installed the user will be directed to installing it.
Screenshots
video: https://photos.app.goo.gl/Q93ppHcNB7u8djY97
Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#450
Any other notes