off-topic a little bit - Mobile app deep linking
-
Hi all
Has anyone tried https://en.wikipedia.org/wiki/Mobile_deep_linking with Qt app ?
For instancje on Android URI like:
myapp://showItem/33138223345
On Android should I add Java class to extend QtActivity, to get this intent in onCreate ?
Is there some way to make it work on iOS ?Best Regards
Marek -
Hi,
If memory serves well, you should implement a custom intent for Androïd and a custom URL scheme on iOS.
-
@SGaist
Hi
On Android developer pages https://developer.android.com/training/app-links/deep-linking#java they say about Intent catched early on in onCreate. So maybe I should extend QtActivity ?public class MyActivity extends QtActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Intent intent = getIntent(); String action = intent.getAction(); Uri data = intent.getData(); } }
And update AndroidManifest about main activity as MyActivity ?
If so, then I could pass somehow this "Uri data" to my applicationBut how about iOS, I mean there is an explanation for Custom URL scheme here for example
https://coderwall.com/p/mtjaeq/ios-custom-url-scheme
But how to catch on Qt side these parameters passed to app in custom URL like this:
myapp://?foo=1&bar=2
How could I read them in Qt app ?Best Regards
Marek -
If I remember correctly, you need to create a custom URL handler and set it through QDesktopService.
For Androïd, yes, you have to extend QtActivity.