Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON FORMA #22

Open
DjarallahBrahim opened this issue Nov 23, 2017 · 2 comments
Open

JSON FORMA #22

DjarallahBrahim opened this issue Nov 23, 2017 · 2 comments

Comments

@DjarallahBrahim
Copy link

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"
}
},
...
}

@izzsta
Copy link

izzsta commented Jul 22, 2018

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.

@fritexvz
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants