Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Thomas Ct
Courses Plus Student 311 PointsParse API
am working on the ribbit application, so pls i there any way i can write a code and add to make me send a text to a user using parse API?
3 Answers
andrewshutler
2,243 PointsYou could use the ParseObject to save a text message in the same way as for the photos/video however, instead of saving a file and file_type, you have a text string containing the message. For example:
ParseObject textMessage = new ParseObject(ParseConstants.CLASS_TEXT_MESSAGES);
textMessage .put(ParseConstants.KEY_SENDER_ID, ParseUser.getCurrentUser().getObjectId());
textMessage .put(ParseConstants.KEY_SENDER_NAME, ParseUser.getCurrentUser().getUsername());
textMessage .put(ParseConstants.KEY_RECIPIENT_IDS, getRecipientIds());
textMessage .put(ParseConstants.KEY_TEXT_MESSAGE, myMessageString);
Thomas Ct
Courses Plus Student 311 Pointsi dont really understand how to implement this, am Beginner pls i need help
Nidhi Saini
2,627 PointsCreate new recipientsTwo class and with new values for storing text message. Follow the steps as in receipientsActivity class https://teamtreehouse.com/forum/android-i-am-using-parse-as-a-backend-and-i-want-to-save-text-message-on-the-backend-how-to-save-text-mesg
//send text message Intent getTextMessage = getIntent(); mTextMessage = getTextMessage.getStringExtra("TextMessage");