Skip to content

Unable to access parse installations after migrating Parse to my own server #1652

@nisaFaheem

Description

@nisaFaheem

Hello. following is the code I am using to subscribe to channels:

// Create a Pointer to this user based on their object id
var user = new Parse.User();
user.id = userId;

// Need the Master Key to update Installations
Parse.Cloud.useMasterKey();

// A user might have more than one Installation
var query = new Parse.Query(Parse.Installation);
query.equalTo("user", user); // Match Installations with a pointer to this User
query.find({
success: function(installations) {
for (var i = 0; i < installations.length; ++i) {
// Add the channel to all the installations for this user
installations[i].addUnique("channels", channel);
}

  // Save all the installations
  Parse.Object.saveAll(installations, {
    success: function(installations) {
      // All the installations were saved.
      response.success("All the installations were updated with this channel.");
    },
    error: function(error) {
      // An error occurred while saving one of the objects.
      console.error(error);
      response.error("An error occurred while updating this user's installations.")
    },
  });
},
error: function(error) {
  console.error(error);
  response.error("An error occurred while looking up this user's installations.")
}

});
});

Ever since I migrated to parse, the installations array is empty. Is there a workaround or is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions