Closed luke- closed 1 year ago
This can be accomplished with the following data definition for and redirect intent (for now impl. only for android but it's also possible for iOS):
<data android:scheme="https" android:host="*.humhub.com" />
We are intercepting all redirects that follow the format: https://{something}.humhub.com/{anything}
PROBLEM:
https://ws_mike.humhub.com
and receives an intent for https://ws_bob.humhub.com
, we need to consider the following:
@luke- , how would you suggest we proceed in this case?
@PrimozRatej Usually HumHub installations run under their own domain, e.g. https://social.example.com - can we somehow cover these cases as well?
Can we simply open mistakenly intercepted Intends with the default browser?
It is probably not possible to change the "manifest" of the app during runtime or?
@luke- Getting the intent for fully dynamic links is not possible. The definition for URL intents is defined in build time so we need to know/have some kind of URL naming scheme for those URLs beforehand.
We can open mistakenly intercepted Intents in the browser, but that would mean redirecting the intent to the app, the app will be opened and will redirect the user to the browser.
Example:
We want to intercept //{something}.humhub.com
but not //www.humhub.com
(Home page)
We do not have the option to exclude intents in AndroidManifest. The intent for //www.humhub.com
will still be fired but we can handle that inside the code at runtime but it will force us to open an app.
The "manifest" of the app can be changed during runtime which would mean clearing the config. for the current manifest and save value for the intent if we want to do so.
My suggestion would be if we really want to cover all the native functionalities such as push notifications intents, share etc. to start looking into Flavors
@PrimozRatej Can we use a parameter or extension to identify HumHub requests?
e.g. we could add a query param humhub=1
to all Notification and Activity Links. e.g. https://intranet.example.com/notification/12354?humhub=1&someother=5
Yes, that will work but it needs to be really something identical something that only we would use.
@luke- Update: This will not work for query params, the problem is that part after the "?" mark is not matched against anything (filter ignores it). Source: https://stackoverflow.com/questions/7277480/match-http-parameters-in-url-with-android-intent-filters Reserved chars: https://stackoverflow.com/questions/23539632/android-intent-filter-detect-url-with-http-get-params
@PrimozRatej Thanks for the info. I would postpone this feature to a later app version.
It would be great it links to the active HumHub URL (e.g. via E-Mail) will be opened inside the app and not inside the standard browser.
https://community.humhub.com/comment/perma?id=43822