示例#1
0
 private void retrieveAccessTokenAndFacebookIdFromRelation(
     final UserDataRetrieveCallback callback) {
   ParseRelation relation = ParseUser.getCurrentUser().getRelation("ItsBeta");
   if (relation != null) {
     relation
         .getQuery()
         .findInBackground(
             new FindCallback() {
               @Override
               public void done(List<ParseObject> parseObjects, ParseException e) {
                 if (e == null) {
                   if (parseObjects.size() == 1) {
                     facebookId = parseObjects.get(0).getString("facebookUserId");
                     accessToken = parseObjects.get(0).getString("facebookAccessToken");
                     callback.done();
                   } else {
                     callback.relationNotFound();
                   }
                 } else {
                   callback.error();
                 }
               }
             });
   }
 }
示例#2
0
 public static void countItsBetaRelationInBackground(CountCallback callback) {
   ParseRelation relation = ParseUser.getCurrentUser().getRelation("ItsBeta");
   if (relation != null) {
     relation.getQuery().countInBackground(callback);
   }
 }