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

Code Challenge Help : Preparing user-to-user Push Notifications.

Challenge Task 5 of 5

Finally, set pushQuery to check where the "userId" field is equal to the playerId parameter. Hint: use the method whereEqualTo(String key, String value).

I keep reading this over and over to see where I'm going wrong in the code, but I can't figure out what's not right. I've tried putting playerId in quotes because it says String Value, but that makes even more errors.

``` java import android.app.Activity; import android.os.Bundle; import com.parse.ParseInstallation; import com.parse.ParseQuery;

public class InviteActivity extends Activity {

/*
 * Some code has been omitted for brevity!
 * This method gets called when an invitation is sent.
 */

public void sendPushNotifications(String playerId) {
 ParseQuery<ParseInstallation> pushQuery=ParseInstallation.getQuery();
 pushQuery whereEqualTo("userId", "playerId");

}

}```

3 Answers

Hi Ginger

The code should read as follows:

pushQuery.whereEqualTo("userId", playerId);

The double quotes are not required around the variable playerId, and you are missing the dot operator to call the whereEqualTo method of pushQuery

Thank you!

that did not passs for mi,,,this one passed

query.whereEqualTo("userId", playerId);

query.whereEqualTo("userId", playerId); this one works