Registering url scheme for app
-
In order to implement OAuth workflows, I need my app to listen to callback URLs called by the browser after authentication. Since I didn't find anything covering ubuntu touch, I tried to follow this example:
[Desktop Entry] _Name=MyApp Exec=MyApp %U Icon=assets/logo.svg Terminal=false Type=Application X-Ubuntu-Touch=true MimeType=x-scheme-handler/myappQML:
Label { id: label Layout.alignment: Qt.AlignHCenter text: i18n.tr('Press the button below and check the logs! ') + Qt.application.arguments[1] } [...]Now after I installed the app on my Volla Phone, whenever I enter
myapp://somethingin the browser, I will get a prompt asking whether or not I will allow to pass this to "some system app", however after accepting, nothing happens.I would expect that
MyAppwill be foregrounded and thesomething-part is passed asQt.application.arguments[1].Does this even work on Ubuntu Touch? If so, what am I missing?
-
Check the url dispatcher section
https://docs.ubports.com/en/latest/appdev/guides/importing-CH-urldispatcher.html -
@kugiigi Thank you, that worked. Although the documentation seems to be outdated / pointing to files not matching the example, so I had to make some adjustments.
-
@s710 Please make PRs then to improve the documents, thanks!
-
@flohack How would I do this?
-
@s710 Well our documentation is hosted here: https://github.com/ubports/docs.ubports.com - you can either clone the repo to your local disk, or make online changes. Then, after submitting the changes, open a pull request and we will review and merge it if ok.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register Login