registering device with multiple channels using android SDK

Hi all,

I’ve managed to register device with single channel, but registering multiple channels throws following error.
I pass List<string> as channels parameter.BackendlessFault{ code: ‘IllegalArgumentException’, message: ‘java.lang.Object[] cannot be cast to java.lang.String[]’ }

Regards,
Scott

Hi Scott!

Ok, we will check this issue and notify you.
Regards,
Kate.

Hi, Scott.

I successfully registered device in multiple channels. Please provide example your code for registration.

Hi Mikhail,

I get it, as I tested

  1. below works
    String a[] = new String[]{“ch_a”,“ch_b”,“ch_c”};
    List list1 = Arrays.asList(a);Backendless.Messaging.registerDevice(GCMSenderId, list1, …2) below failsList list0 = new ArrayList<String>();
    list0.add(“ch_a”);
    list0.add(“ch_b”);
    list0.add(“ch_c”);
    Backendless.Messaging.registerDevice(GCMSenderId, list0, …
  1. below fails
    list0.add(“ch_a”);
    list0.add(“ch_b”);
    list0.add(“ch_c”);
    Backendless.Messaging.registerDevice(GCMSenderId, list0, …

Mikhail,
I thought below would work, but fails.
List list = Arrays.asList(channels.toArray());How can I call registerDevice with dynamic array?Regards,Scott

I fixed this issue. You can download last version android SDK.

Scott, make sure to download it from the github repository (as opposed to our website):

Got it, thanks for quick update.