Support Topics Documentation Slack YouTube Blog

Error removing channel from device record, and rescanning DeviceRegistration

(Carlos Alberto) #1

I need to subscribe and cancel channels from the same user to receive notifications. I noticed that there is only method to inscribe (add) channel and not remove, correct?

Due to some limitations, the solution would be to delete the device record and create again, as this can occur several times with the user, I have problem when calling from the second time the following call:

 DeviceRegistration devReg = new DeviceRegistration();

PROBLEM - devReg = Backendless.Messaging.getDeviceRegistration();

I/art: Rejecting re-init on previously-failed class java.lang.Class<$JobServiceEngineImpl>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/app/job/JobServiceEngine;

From what I’ve researched, the error can occur in several devices while others do not … Is there any solution to this?

(Sergey Kukurudzyak) #2


could you send us your project or short code snippet to reproduce the issue?

(Carlos Alberto) #3

For example:

DeviceRegistration devReg = new DeviceRegistration();

// if exists, searched for, if not, error BackendlessException
devReg = Backendless.Messaging.getDeviceRegistration();

// if an error occurred, log
Backendless.Messaging.registerDevice (ID, channels, date);

// after registering, search
devReg = Backendless.Messaging.getDeviceRegistration(); // error stated above

// after assigning to the devReg the first search, from the second always of the error