Closed luke- closed 2 months ago
@luke-
"Push notifications are not supported by this installation."
Route is /fcm-push/status
Hey @luke-,
There is a minor issue here. The community page exposes ${manifest.baseUrl}/fcm-push/status
to the public, allowing data access without authentication. For private instances like sometestproject12345 and Omrade, which require authentication, the status is inaccessible without logging in.
We use the dio package for communication with the REST API, which is not authenticated because authentication occurs inside the webview, where the user state is managed. The webview does not support advanced web client functionalities. It is possible to parse the returned HTML and extract JSON, but I would like to avoid that.
I would use JS message method, similar to how we did for registering the FCM token.
@luke- @PrimozRatej Why not displaying this warning to logged admins only? I think the most important is to inform them their HumHub instance is not well configured for the mobile app and how to do it.
It might even be better not displaying the warning to non-admins, because maybe some communities will want to use the app without push feature.
What do you think?
@luke- @PrimozRatej Why not displaying this warning to logged admins only? I think the most important is to inform them their HumHub instance is not well configured for the mobile app and how to do it.
It might even be better not displaying the warning to non-admins, because maybe some communities will want to use the app without push feature.
What do you think?
I believe this would also work better when https://github.com/humhub/fcm-push/issues/24 is implemented, I've also contributed a modified version of the P/R within this issue to implement the grant statuses with @luke-'s points in mind and can say overall it works rather well, but it could be updated to also handle this issue.
@luke- @PrimozRatej Why not displaying this warning to logged admins only? I think the most important is to inform them their HumHub instance is not well configured for the mobile app and how to do it.
It might even be better not displaying the warning to non-admins, because maybe some communities will want to use the app without push feature.
What do you think?
We can also do it that way.
But if we only want to implement a warning for admins, we should implement this on the HumHub module side in the fcm-push
module.
on the HumHub module side
Maybe we could use the HumHub-Mobile
user agent marker to detect when we're viewing HumHub from the mobile app: https://github.com/humhub/app/issues/182#issuecomment-2179376171
We could take this opportunity to create:
humhub\modules\ui\helpers
, e.g. UserAgentHelper
, with static methods such as:
isHumHubMobileApp
which will return str_contains(Yii::$app->request->getUserAgent(), 'HumHub-Mobile')
ui.userAgent
(even if we don't need it for the moment, but could be useful for some modules), with methods such as:
isHumHubMobileApp
which will return /HumHub-Mobile/i.test(navigator.userAgent)
isMobileBrowser
which will return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
html
or body
HTML tag, e.g. is-humhub-mobile-app
?Then, we could add the warning to the IncompleteSetupWarning
widget?
@marc-farre We already have some helper here: https://github.com/humhub/fcm-push/blob/master/helpers/MobileAppHelper.php#L58
Maybe we could copy that, for now somewhere into the core.
At some point we should think about integrating at least some app parts of the fcm-push
module directly into the core.
@luke- done:
@luke- Do you want me to add the warning to the IncompleteSetupWarning
widget using the new DeviceDetectorHelper
?
@marc-farre Yes, that would be fine! Thanks!
@luke- PR https://github.com/humhub/humhub/pull/7166
What do you think about this view?
I had to rework the "Open documentation" button, because it's not the same link for the push notification configuration. I didn't find a better solution than display twice the same button for the 2 cron job warning.
@marc-farre Thanks, the PR looks good!
@Eladnarlea Can you please check the buttons?
@luke- I would suggest to do it in the style of the alert/prerequisites design.
In case you do not wish to implement it yet, we could only implement the icon-button help-link
first, but also add one icon-button view documentation
to the bottom of the window
EDIT: in terms of layout and sizes I am unsure how your suggestion would look like, implemented, @marc-farre. I find it difficult to evaluate your design & button positions for this reason. Could you please provide the whole screen for mobile and desktop, @marc-farre ? :)
@Eladnarlea Thanks, unfortunately I don't have time for the Requirement Redesign topic at the moment. But I would like to take a closer look at the design here before implement.
So I would suggest that we first add buttons (or a simple link) and not change the design at all. Later in the requirement redesign we can also consider this sidebar element.
@marc-farre Can you please add a simple plain link regarding the app for now. We'll hopefully redesign this soon.
@luke- @Eladnarlea commit https://github.com/humhub/humhub/pull/7166/commits/b452871b144007144f40e40aa1c6baa2681b6d22
Or did you want to keep the existent "Documentation" button for cron jobs and add a warning about the mobile app bellow?
The help buttons looks a bit strange vor me. Maybe just?
@luke- in order to unify the software, could we please try to use the unified version like in the prerequisites used, already? Meaning using the [icon] Help
"ghost button?
I think, what you didn't like about the help button was not the button itself, rather the styling of the link-icon
- If @marc-farre could just make it the same font-size as the help
font size itself, as well as using capitalisation "H"elp
AND for now maybe using fnot-weight: 500 for Help
?
I think that would do the job. @luke- what do you reckon?
@Eladnarlea I haven't had a closer look at the new Prereq design yet... so I don't want to already start implementing it in this unrelated task.
@luke- Is my PR fine, or you want changes on it?
@marc-farre Thanks, it's fine. But there will be UI changes as soon we refactoring the PreReq page :-)
@luke- I close this issue. We can open a new one about UI refactoring.
The app should display a warning dialogue if the selected HumHub installation does not have a configured push module installed.
The status can be queried via: https://github.com/humhub/fcm-push/issues/37
Warn text could be, for example:
‘No push notifications are available for the selected HumHub installation. Contact the administrator for more information.’
@Semir1212 can you check the text please?