Support Topics Documentation Slack YouTube Blog

Register device cause crash

(Allan) #1

My apps start getting crash when register device
APPLICATION_ID 161CA8CE-7AC3-2596-FF77-73632D3ED600
It crashed both on all android and ios devices.
On android device, it return a success message “register device: Device has been subscribed to channel userwCF3H4FNrmWQ5IshvmyAGUToDhf2”, but then 30 seconds after, it crash with “Could not register device on Backendless server: timeout”.
For iOS, app get freeze with register device function, no success or error message and finally crash.
I have been using those code in past 4 months, the problem start on last Friday morning and was solved for while and get back this morning,
See this
java.lang.RuntimeException: Could not register device on Backendless server: timeout
at com.backendless.push.BackendlessPushService.onError(
at com.backendless.push.BackendlessPushService$1.handleFault(
at com.backendless.Messaging$2.handleFault(
at com.backendless.async.message.AsyncMessage$FaultHandler.handle(
at com.backendless.async.message.AsyncMessage.handleCallback(
at com.backendless.core.AndroidCarrier$1.handleMessage(
at android.os.Handler.dispatchMessage(
at android.os.Looper.loop(
at java.lang.reflect.Method.invoke(Native Method)
Android code

try {
 List<String> channels = new ArrayList<String>();
 Calendar cal = Calendar.getInstance();
 cal.add(Calendar.YEAR, 10);
 Date expiration = cal.getTime();

 Log.e(“register device”, “expiration ” + expiration);
 Log.e(“register device”, “channels ” + channels);

 Backendless.Messaging.registerDevice(context.getString(R.string.google_project_number), channels, expiration, new AsyncCallback<Void>() {
 public void handleResponse(Void response) {
 if(DEBUG) Timber.v(“Device has been subscribed to channel ” + channel);
 Log.e(“register device”, “response ” + response);

 Log.e(“register device”, “Device has been subscribed to channel ” + channel);


 public void handleFault(BackendlessFault fault) {
 if(DEBUG) Timber.v(“Device subscription failed. ” + fault.getMessage());
 Log.e(“register device”, “Device subscription failed. ” + fault.getMessage());
 } catch (Exception e) {
 Log.e(“register device”, “Device subscription failed. ” + e.getMessage());
 return false;

iOS code

-(void) subscribeToPushChannel: (NSString *) channel {
 NSLog(@"subscribeToPushChannel %@", channel);
 if (!_isSubscribed) {
 channel = [self safeChannel:channel];
 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
 NSData *token = [defaults objectForKey:@"backendless_deviceToken"];
 if (token) {
 @try {
 NSCalendar *cal = [NSCalendar currentCalendar];
 NSDate *expiration = [cal dateByAddingUnit:NSCalendarUnitYear value:10 toDate:[NSDate date] options:0];
 NSString * deviceRegistrationId = [backendless.messaging registerDevice:token channels:@[channel] expiration:expiration];
 NSLog(@"subscribeToPushChannel success deviceRegistrationId: %@", deviceRegistrationId);
 _isSubscribed = YES;
 @catch (Fault * fault) {
 NSLog(@"subscribeToPushChannel FAULT = %@ <%@>", fault.message, fault.detail);
 }@finally {

(Vladimir Upirov) #2

Hello Allan

We’ve create an internal ticket BKNDLSS-16710 for investigation your issue, and we will notify you here about any result

And I’ve switched mode of the topic from private to normal, private topic is available only for Managed Backendless and Backendless PRO plans

Thanks, Vladimir

(Vladimir Upirov) #3

Do you still have the problem?

(Allan) #4

The problem was gone yesterday afternoon at 3pm, but it’s backed today about half hour ago. The problem seem to come back at about 9:30am every day since last Friday.

(Allan) #5

It’s working now.