Hello,
We want to make our Font icons compatible with the Confluence Server mobile app.
Unfortunatly this is not working out of the box… (enabling mobile device support).
So, my questions are:
- Why is this not working?
- The documentation is very limited and doesn’t say anything about specific limitations or provides any solutions.
- Is there a way to do debugging within the app (I assume it is just showing a browser itself)?
- Any other advice?
Follow up
- Enabling mobile support is working in the “mobile” website
- the mobile app doesn’t seem to load CSS (and propably JS)
- the flag “mobile” (conversionContext.getOutputDeviceType()) is valid for the app and the website → How is it possible to distinguish requests between them?
Thanks,
Adrian
@amoerchen, (interesting mention name)
Could you please describe your intention?
Some technical details:
- the confluence mobile app, indeed, uses the js for view rendering. Shared code for ios and android.
- this is not the code that is used for desktop-browser, way more simplified.
- any macros and extensions are not supported, and super limited. It is in internal backlog to find a working solution for making extensions possible.
- since no customisation, debug itself doesn’t make much sense right now.
- consider that view is higher on priorities than editing, due to “on the go” nature of mobile content digesting. So important to understand what we missing.
So it is super important to understand what you try to achieve.
Also I assume we are not clear on some kb that extensions/custom macros are not supported yet for mobile. If we declare this somewhere, this is a mistake and should be fixed.
Regards,
Dmytro (from Server Mobile team)
@dmakhno
(my name was generated from my email adress, I already have a ticket open to get it changed, seems to be problem …)
What we want in this case:
- Just render some font icons (i.e. Font Awesome, basically CSS and a font)
My problem starts, when I enable mobile support for the macro
- mobile support is used for both mobile variants, the web and app" versions
- but in web it’s working, as this is just a normal browser
- in app it’s not working, because there are too many restrictions
Simple question:
- Is there a way to distinguish between mobile app and mobile web requests?
- → so I can create another fallback for the mobile app
There maybe should be a third device type “app”
<xhtml-macro ....>
...
<device-type>mobile</device-type>
<device-type>app</device-type>
....
Else, you should stop advertising the app, as even internal macros don’t work… Better provide a functional responsive design instead, or a PWA.
Addition:
Then I also can’t use the app to connect my local development environment (and maybe introspect request headers), because of missing SSL or whatever…
Hello there @amoerchen !
We are not supporting macros in Server Mobile apps, so it is not possible to add any macros or even downloadable js or css files to the page. Currently, we are using only html body to render page content.
Is there a way to distinguish between mobile app and mobile web requests?
You can’t do this in release build, the only one option is use debug build or ask someone from Server Mobile team directly.
For getting page body we are using the following api:
GET /nativemobile/1.0/content/{PAGE_ID}?pagepropertiesreport.serverrender=true
Regarding your login issue, you can check this, hope you will find solution. Otherwise, let us know about your instance configuration.
Hope, I answered on your question.
Best wishes,
Ivan (from Server Mobile team)
@IvanHalitskyi Thank you
We are not supporting macros in Server Mobile apps, so it is not possible to add any macros or even downloadable js or css files to the page. Currently, we are using only html body to render page content.
Basically you do support them, as they are “rendered” as soon as mobile device type is enabled.
They are rendered, but correctly (in our case they are just empty)
→ maybe better don’t support them at all, when the request comes from the app.
Regarding your login issue, you can check this, hope you will find solution. Otherwise, let us know about your instance configuration.
Unfortunately I don’t have access to the page you have linked.
The mobile app is sending a specific HTTP header “mobile-app-request”.
It is possible to do something like this:
/**
@param context The Velocity context.
*/
private boolean isMobileAppRequest(Map<String, Object> context) {
Object request = context.get("req");
if (request instanceof HttpServletRequest) {
return "true".equals(((HttpServletRequest) request).getHeader("mobile-app-request"));
}
return false;
}