Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update openLink documentation #92

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .gitbook/assets/account.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/adprivacy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed .gitbook/assets/app-disambiguation_2x.png
Binary file not shown.
Binary file added .gitbook/assets/chooser1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/chooser2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/notifications.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/open1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/open2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/open3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/otherad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 27 additions & 4 deletions api-reference/commands/openlink.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ To open a link on a device (i.e. a deep link):

### Auto verification of your Android Apps 
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Auto verification of your Android Apps 
### Auto verification of your Android Apps


If your app shows a disambiguation dialog along with other apps that can open the web link:
On Android, applications can declare intent filters for handling the opening of some links from specific domains.

 ![](../../.gitbook/assets/app-disambiguation\_2x.png)
If the app had implemented [App Links](https://developer.android.com/training/app-links#android-app-links) in order to verify the association with these domains by hosting a Digital Asset Links JSON file, the link would open the app automatically.

If not, the behavior would depend on the Android version of the device.

Starting from Android 12, such apps needs for the user to manually verify the association of the app with the domains through the "Open by default" settings menu.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Starting from Android 12, such apps needs for the user to manually verify the association of the app with the domains through the "Open by default" settings menu.
Starting from Android 12, such apps need the user to manually verify the association of the app with the domains through the "Open by default" settings menu.


Before Android 12, the system would show a disambiguation menu (called "Chooser") for the user to choose which app to use.

You can auto-verify the web link to be opened by your app with `autoVerify` attribute:

Expand All @@ -19,15 +25,32 @@ You can auto-verify the web link to be opened by your app with `autoVerify` attr
link: https://example.com
autoVerify: true
```
Starting from Android 12, setting `autoVerify` to true will automatically enable the verification of the domain of the link as if the user manually enabled it through the "Open by default" settings menu.

| Chooser | Choice |
|-------------------------------------------------------------|--------------------------------------------------------------|
| <img src="../../.gitbook/assets/chooser1.png" width="200"/> | <img src="../../.gitbook/assets/chooser2.png" width="200"/> |

Before Android 12, setting `autoVerify` to true will automatically pick the app in the Chooser.


| Before verification | Supported links | After verification |
|----------------------------------------------------------|----------------------------------------------------------|----------------------------------------------------------|
| <img src="../../.gitbook/assets/open1.png" width="200"/> | <img src="../../.gitbook/assets/open2.png" width="200"/> | <img src="../../.gitbook/assets/open3.png" width="200"/> |

Beyond Android version 12, web links are by default opened in the web browser. It is possible for maestro to also auto-accept agreements of Google chrome if shown with the same `autoVerify` flag.

### Opening web links in the browser for Android

It is possible with maestro to force open web links with the web browser:
It is possible with maestro to force open web links with the web browser (Chrome):

```yaml
- openLink:
link: https://example.com
browser: true
```

In that case, setting `autoVerify` to true would skip the various Chrome onboarding screens.

| Accept | Sign in | Sync | Notifications | Ad privacy | Other ad privacy |
|-----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|-------------------------------------------------------------------------------------------------|------------------------------------------------------------------|----------------------------------------------------|--------------------------------------------------|
| ![chrome_welcome_accept](https://github.com/user-attachments/assets/95a899f7-a375-455c-91ff-e15e2cbf6c79) | ![chrome_welcome_account](../../.gitbook/assets/account.png) | ![chrome_sync](https://github.com/user-attachments/assets/8e790d27-fe89-470d-a28b-1bda8853f59d) | ![chrome_notifications](../../.gitbook/assets/notifications.png) | ![ad_privacy](../../.gitbook/assets/adprivacy.png) | ![ad_privacy](../../.gitbook/assets/otherad.png) |
Comment on lines +53 to +56
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that these demonstrations are necessary. WDYT?