FirebaseAndroidChat icon indicating copy to clipboard operation
FirebaseAndroidChat copied to clipboard

JSON FORMA

Open DjarallahBrahim opened this issue 8 years ago • 2 comments

Hi thank you for this guide i want to change the JSON FORMA for location message how can i do it ? i try to add attribute to LocationModel (String type ) to get this forma { "chatmodel":{ "-KLId9H8NBsmrwO6SKEo" : { "mapModel" : { "latitude" : "-3.084669", "longitude" : "-60.010532" ======> "Type": "location" }, "timeStamp" : "1467060908238", "userModel" : { "name" : "Alessandro Barreto", "photo_profile" : "xxxxxxxxxxxxxxxxxxx" } }, ... }

DjarallahBrahim avatar Nov 23 '17 13:11 DjarallahBrahim

The JSON forma is created in response to the object or items that is passed to it. So I think all you would need to do to get this extra field is to add "type" as a variable in the mapModel class, and then make sure the type is defined when first passing it to the database.

izzsta avatar Jul 22 '18 15:07 izzsta

Change it in the MapModel.java file, alter in ChatFirebaseAdapter and MainActivity if needed.

fritexvz avatar Jun 10 '19 01:06 fritexvz