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

Android

Get Messages from friends i follow only Ribbit android app

How can i get messages from only the friends i follow ribbit android?

2 Answers

If you use a separate back-end within Parse for the iOS and Android apps, the friends won't overlap.

At the moment, you're probably using the same API key in each application. If you generate a new app in Parse and get a new API key, you can use one key for Android and another for iOS.

I hope that makes sense!

Steve.

but in the app at the moment we can get messages from anybody that sends us a message how can i only make that so i get a message from my friends relations

Ah right - I understand now. I though the app required the other user to have a Friend Relation before you could send a message to them ... let me look at my app and see what needs to change.

Steve.

The Recipients list is made up of people that are the user's 'friends' so they do have that relation. I'm not sure if that relation works in both directions, though.

So, I log in as a user and I can select who I want to be friends with from the EditFriendsActivity. Let's say, I leave only myself and one other user selected as friends. I then log in as the other user and specifically make sure that I deselect the original account so that user 2 is not a friend of user 1.

Logging back in as user 1, the previously selected relation is there still. So, this relation is like Twitter. You can follow me without me following you, whereas you want it to work like Facebook, where the friendship is automatically mutual. No I see where you're coming from!

So, we can either make the relation mutual, which doesn't really fix your issue - you only want to receive messages from people you've accepted as friends. Allowing them to make that decision for you is wholly against what you're trying to achieve! So, when populating the InboxFragment (and I'll be honest, I can't see which bit of code populates the messages in there!) you want to filter out message that have come from anyone whoh you do not follow.

If I could figure out where the messages are populated into the Inbox, I might be able to help with that. My code is an old version of the app; my phone has the complete version installed along with all the funky graphics. I don't know where the phone's app code is hiding, though. I'll do some digging and see if I can find it.

I might have to do the course again to remind me!

thanks Steve