Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add new line character in remote config text

I'm doing Firebase RemoteConfig integration. In one of the scenarios, I need to break a text line, so I tried to use new line character (\n).

But this is not working, it is neither displaying as an extra character nor creating another line.

like image 359
CoDe Avatar asked Apr 10 '18 06:04

CoDe


2 Answers

My solution is replace \n manually (assuming that in Firebase Console you put property for TITLE as "Title\nNewLine"):

FirebaseRemoteConfig.getInstance().getString(TITLE).replace("\\n", "\n")
like image 110
kasurd Avatar answered Nov 06 '22 15:11

kasurd


Try using an uncommon character like two pipes || and then replacing every occurance of those with a newline after you do getString() in the code.

like image 24
Mayank Jain Avatar answered Nov 06 '22 14:11

Mayank Jain