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

Support for custom URI schemes. #95

Open
pressRtowin opened this issue Jan 31, 2023 · 12 comments
Open

Support for custom URI schemes. #95

pressRtowin opened this issue Jan 31, 2023 · 12 comments

Comments

@pressRtowin
Copy link

I have some apps that I have multiple instances of installed. They use magic links with custom URI schemes to log in, but I have no way to control which copy of the app gets opened when I load the link from my browser. It doesn't appear that OpenLinkWith supports these links, as when I select the link and share to OpenLinkWith, the intended target apps aren't given as choices, but browsers are.

@1fexd
Copy link
Contributor

1fexd commented Feb 18, 2023

Could you provide such a magic link?

@pressRtowin
Copy link
Author

Could you provide such a magic link?

Not really, as they are used for authentication. That being said:

  1. Magic links are fairly well documented online
  2. The fact that they are magic links is, as far as I can tell, entirely irrelevant here as that's just the function of the link, and magic links can be implemented as standard web addresses as well. The issue at hand is that there is no support for custom URI schemes to be directed towards a specific application if multiple apps exist which can handle them. That detail was only included as an example of why it's important to have the ability to direct such links to the preferred application.

@1fexd
Copy link
Contributor

1fexd commented Feb 19, 2023

I have pushed this as a test to https://github.com/1fexd/OpenLinkWith/tree/feature/custom-uri-schemes, can you build it yourself to test it or should I provide you with an APK?

@pressRtowin
Copy link
Author

I have no way to build it at the moment, but I can test it out if you're able to provide an apk

@1fexd
Copy link
Contributor

1fexd commented Feb 19, 2023

@pressRtowin
Copy link
Author

pressRtowin commented Feb 19, 2023

Well I've run into one problem already. Despite the applications being set to not open links, tapping on the custom URI link immediately opens the app without any prompt.

What I can do is copy and paste the custom URI link, then share it and open it using Open Link With that way, however doing so only returns a list of the available browser apps on my device, and when selecting any of them, you can see that Open Link With has taken customscheme://whatever/goes/here and replaced it with https://customscheme//whatever/goes/here, which is the same behavior as before.

It's worth noting that https://github.com/TrianguloY/UrlChecker, which among other things also includes similar functionality to Open Link With, is able to correctly parse the custom URI scheme and pass it on to the appropriate app. The only problem is that it's unable to correctly open an app installed under the Dual Messenger profile (User 95) and will instead open the copy of the app installed on the main user (User 0) even when attempting to open from a copy of URL Checker which is itself installed on User 95. This is a common symptom of Dual Messenger apps for some reason. Unlike work profile and Secure Folder apps (Users 10 and 150), which behave as fully independent profiles, the Dual Messenger profile is deeply integrated with the main user, which causes some (but not all) apps to have trouble distinguishing them.

See this for a deep dive on how various activity launching apps handle launching activities on various profiles. Not sure if it'd help here, but it illustrates my point about Samsung's Dual Messenger feature being very . . . odd.

@1fexd
Copy link
Contributor

1fexd commented Feb 19, 2023

Wow, I did not know about that app. Maybe it would be easier to contribute to that app by implementing a fancy "share-sheet" (the thingy OpenLinkWith has right now) instead of fixing this app.

@pressRtowin
Copy link
Author

pressRtowin commented Feb 19, 2023

Wow, I did not know about that app. Maybe it would be easier to contribute to that app by implementing a fancy "share-sheet" (the thingy OpenLinkWith has right now) instead of fixing this app.

Tbh, I'd love if URL Checker had a share sheet rather than a drop down menu. It is able to redirect links to open in multiple other apps, but for the custom URI, it simply doesn't see that there's any other option other than the app installed on User 0 for both URL Checker on User 0 and User 95. I also find OpenLinkWith's behavior of showing the package name if multiple apps of the same name are installed to be invaluable, something that URL Checker doesn't have.

@1fexd
Copy link
Contributor

1fexd commented Feb 19, 2023

Tbh, I'd love if URL Checker had a share sheet rather than a drop down menu.

I have opened an issue about this topic.

@Ilithy
Copy link

Ilithy commented Feb 19, 2023

I also find OpenLinkWith's behavior of showing the package name if multiple apps of the same name are installed to be invaluable

This is very interesting and relevant, and I think deserves to be sent to the developer of URLCheck to be added as an option for displaying apps in the "famous" drop-down menu (Open and Share module)

@pressRtowin
Copy link
Author

Actually, I think I've discovered the root issue here.

So I have 4 copies of both OpenLinkWith and URL Checker installed (in Main, Dual, Work, and Secure Folder profiles), and while the copies of both programs in the Main, Work, and Secure Folder profiles correctly display the applications installed in their respective profiles, the copy of OpenLinkWith and URL Checker installed on the Dual Messenger profile both show User 0's applications, not User 95's.

@pressRtowin
Copy link
Author

@1fexd I'm not sure if this is due to the changes in 2.10 (since there is still no apk available here for it) or if it's something you changed in trying to get custom URI schemes to work, but I wanted to let you know that the version you sent me has also completely removed OpenLinkWith from the "Open with" dialog. It only appears in the "Share" dialog now. It's also not able to be set as a browser anymore (the in-app toggle still exists but the application does not get listed with other browsers when choosing a default one in the OS settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants