Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

226
Vistas
Delete PFUser on Parse Server

Since Apple is requiring all apps that allow for account creation to also allow for account deletion in app, I am trying to update my app that uses Parse to follow guidelines. I have a CloudCode function set up:

Parse.Cloud.define("deleteUserWithId", function(request, response) {
        var userId = request.params.userId;
        var query = new Parse.Query(Parse.User);
        
        query.get(userId).then(function(user) {
           
            return user.destroy();  { useMasterKey: true }
        }).then(function() {
            response.success(user);
        }, function(error) {
            response.error(error);
        });
    });

I then call it from the app as:

PFUser *me = [[PFUser currentUser] fetch];
        NSString *objectID = me.username;
        [PFCloud callFunctionInBackground:@"deleteUserWithId"
                           withParameters:@{@"userId": objectID}
                                    block:^(NSString *success, NSError *error) {
                                        if (!error) {
                                            NSLog(@"Successful deletion");
                                        }
                                        else {
                                            NSLog(@"%@", error.description);
                                        }
                                    }];

The NSLog prints out "Successful deletion", but in my Parse database, the user still shows up. In Cloud Code section I get this message:

UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda