How to change CSS in MOBILE app depending on the user in session?

How to change CSS in MOBILE app depending on the user in session?

  

Hi all,

Right now I am building an application where all users for a certain tenant need to have there own unique CSS and logo.

I managed to generate and store the CSS and logo per tenant in the database, but I can't figure out how to apply the CSS from the database in the mobile application. Is there a solution to apply the CSS in the application from the database?

Kind regard,
Rens

Hi Rens,

Hugo has a great post on that subject. It's for web but you can easily reproduce it in mobile.

https://www.outsystems.com/forums/discussion/11432/howto-change-css-depending-on-the-user-in-session/


Cheers,

João

João Heleno wrote:

Hi Rens,

Hugo has a great post on that subject. It's for web but you can easily reproduce it in mobile.

https://www.outsystems.com/forums/discussion/11432/howto-change-css-depending-on-the-user-in-session/


Cheers,

João

Hi Joao,

Thanks for your reply. I actually already made the first 6 steps from his example (generate and store CSS and logo in database). The problem is actually in his last step (7: download theme preperation) because there is no download function in mobile. Can you maybe tell me if there is a workaround or solution for the last step in mobile?

Cheers,
Rens


Hi Rens,

Try to see how this component works: https://www.outsystems.com/forge/component/2253/silk-ui-mobile-customizer-preview/

I´ve never use this component yet, but its original purpose is change in runtime the mobile theme. In this case you scan QR code from mobile theme customizer and your app reflects the new theme. Maybe studying this code, you can discover how they do that and this help you to find a solution for your use case.

Best regards

Fabio


Fantato wrote:

Hi Rens,

Try to see how this component works: https://www.outsystems.com/forge/component/2253/silk-ui-mobile-customizer-preview/

I´ve never use this component yet, but its original purpose is change in runtime the mobile theme. In this case you scan QR code from mobile theme customizer and your app reflects the new theme. Maybe studying this code, you can discover how they do that and this help you to find a solution for your use case.

Best regards

Fabio


Hi Fabio,

Thanks for your advice. I studied the application, and they actually have some functionality to apply the CSS to the mobile application for a preview, but I am not able to figure out how I should be able to use that. They retrieve the CSS from a REST API. That's basically what I managed to do (generate and store the CSS in the database) but the last part, applying CSS is the thing I am not able to do. Maybe some one can explain me how to use it in an example, or another solution?

Cheers,
Rens