Backendless Support
 
Solved

Error 5000 after manually deleting all my devices in the backendless console

Hi,

I have manually deleted all my devices in the backendless console and from then on when performing the sentence:

"Backendless.Messaging.getDeviceRegistration"

I get the error 5000.

What solution does this have?

Regards,

Leave a Comment

Comments (20)

photo
1

Hi,

I can not make any device registration, either new or old ... and before deleting them I manually from the console had no problem.

It may be that you need to update some parameters of the application?

App Id: 3A59429E-42BC-7539-FF2C-DB06D1A68900

Regards,

photo
1

Joan,

I connected to your app and registered a device. I had no problem with that at all. You can see my device registration in console.

What error are you getting?

Mark

photo
1

This one:

"BackendlessFault{ code: '5000', message: 'Unable to retrieve device. Invalid device ID.', detail: 'Unable to retrieve device. Invalid device ID.' }"

photo
1

That one makes sense - you cannot retrieve a device registration because there are no device registrations in the app. The DeviceRegistration table is empty. As you said, you deleted them all.

photo
1

Correct, ... but is that previously I perform the registration of the device via api and is not registered.

This is the real problem. (Ihad no problem before).

photo
1

My registration:

void registraDispositivo() {

Backendless.Messaging.registerDevice("766469391729", "default", new AsyncCallback<Void>() {

public void handleResponse( Void response ) {

.......

}

public void handleFault( BackendlessFault fault ) {

error 5000 !!

}

});

}

photo
1

What error do you get when register a device?

photo
1

What does the text of the error say?

photo
1

Sorry, the complete code is:

public void recuperaIdentificador() {

Backendless.Messaging.getDeviceRegistration( new AsyncCallback<DeviceRegistration>() {

public void handleResponse( DeviceRegistration deviceRegistration ) {

Globales global = new Globales();

global.identificadorDispositivo = deviceRegistration.getDeviceId();

global = null;

}

public void handleFault( BackendlessFault backendlessFault ) {

Error 5000 !!!!!!!!!!!

}

} );

}

void registraDispositivo() {

Backendless.Messaging.registerDevice("766469391729", "default", new AsyncCallback<Void>() {

public void handleResponse( Void response ) {

recuperaIdentificador();

}

public void handleFault( BackendlessFault fault ) {

Globales global = new Globales();

global.error = 161;

global.pantallaDeRegreso = "Registrarse";

Intent intent1 = new Intent("apps.jmm.cat.sharemyneeds.errores");

global = null;

registrarse.finish();

startActivity(intent1);

transiciona();

}

});

photo
1

What does the error say?

photo
1

Unable to retrieve device. Invalid device ID.

photo
1

Did you read my messages above? "Backendless.Messaging.getDeviceRegistration" will NOT work and WILL give you an error.

photo
1

Can you look at the attached file?

photo
1

Please see this:f19ad294c68cec01d59d8f19c26b320b

photo
1

Ok, the problem is that the follow registration method does not generate any error but does not register my device and before manually deleting the devices in the console i performed them :

void registraDispositivo() {

Backendless.Messaging.registerDevice("766469391729", "default", new AsyncCallback<Void>() {

public void handleResponse( Void response ) {

recuperaIdentificador();

}

public void handleFault( BackendlessFault fault ) {

Globales global = new Globales();

global.error = 161;

global.pantallaDeRegreso = "Registrarse";

Intent intent1 = new Intent("apps.jmm.cat.sharemyneeds.errores");

global = null;

registrarse.finish();

startActivity(intent1);

transiciona();

}

});

}

photo
1

Put breakpoints in the handleResponse and handleFault methods and see what happens there.

I mean check in the debugger what you get back when you register your device.

photo
1

The handleResponse result is ok in the registration method but with response = null. Is this a problem?

What other variable can I look at?

photo
1

  1. Double check the first argument for the registerDevice method
  2. Make sure BackendlessPushReceiver is properly registered in your Android manifest.
  3. Check for any errors in the Android logcat

photo
1

Hi Mark,

First of all, thank you very much for your help.

The problem really was that the device ID can not be retrieved just by performing ok the device registration statement.

Apparently, it does not allow time for the registration to occur ... and 5000 error is generated when attempting to retrieve the identifier.

Therefore, I retrieve it later in another action and now I have no problems !!

Regards,

photo
1

Hi Joan,

I am glad you got it resolved!

Regards,

Mark