Register Device to list of channels

Hi guys,
I want to add push notifications to my app. In app i have some kind of events and i want to create channels for them. As i read somewhere in forum we are unable to unregister device just from one channel so i need to make some work to implement it by myself. Created Channel class for store channel it’s simple class with one field String name which store name of channel. I store list of Channel in backendlessUser.property. Just made working fetching and updating this list. But now when i want to register device to list of this channels it’s doesnt work. It’s a bit wierd becouse sometimes it’s create channel ( i can see it in console) but dont register device into channel. And sometimes it’s doesn’t even create channel. Here is a link of my methods http://pastebin.com/kBhFGdvh
PS: In register method i used also async version of this method. It doesn’t return any error

Hello!

I’ve noticed that inside your “private static void registerDevice( Date expiration)” method you call sync version of “registerDevice”. Try to change it to async - pass callback as the last argument.
Hope it helps.
Alex

Hi Alexandr,
As i wrote in Post Scriptum i also used async version and there was no error and doesnt work.

Have you tried to debug your code? Make sure that channels list has expected value right before calling “Backendless.registerDevice()”.
Also you didn’t show “getUserChannels” method implementation.

Yep. Debuged right before insertion.

And here u have getUserChannels method and rest http://pastebin.com/nfDSasET

Thank you for sharing, we’ll look into it.

One more question: does your device get registered if you try to register it in easier way, say, to “default” channel?

Yes. Also i was able to register to single channel.

Unfortunately we cannot reproduce your issue - registering to multiple channels feature is working fine. Also, debugging your code for free is out of our support policy.
Here are two ways of resolving it:

  1. You can buy single incident support ticket in market-place and send your project to us so we can debug it and find out the reason. If the issue is really on our side - money would be returned
  2. Double-check your code right before calling Backendless.Messaging.registerDevice(“XXXXXXXX”, channels, expiration); method. If you find a bug - send us a code snippet reproducing the issue.

Well i made tripple-check of my code here u have proofs.
It’s creating channel but don’t register device into it. There’s any other step where i can make some mistake?

console2.png

Hi Łukasz,

Can you please prepare and send us a minimal sample app, which would reproduce the behaviour you describe? It would help a lot.