Cannot subscribe to messaging channel

Hello,
I am trying to subscribe to different chat channels
i.e → this.chatChannel = Backendless.Messaging.subscribe(“953073C4-A2F4-40E5-8CB9-2FDFA5DBE2F2_chat”);
but I am receiving the following error (Backendless debug mode)
[TO SERVER] - [event: SUB_ON] - arguments: {“id”:“sIi0BkxI1665044498931”,“name”:“PUB_SUB_CONNECT”,“options”:{“channel”:“953073C4-A2F4-40E5-8CB9-2FDFA5DBE2F2_chat”}}

[FROM SERVER] - [event: SUB_RES] - arguments: {“id”:“sIi0BkxI1665044498931”,“error”:{“message”:"You don`t have permission to take action on this service ‘messaging’ and this operation ‘subscribe’, subject ‘953073C4-A2F4-40E5-8CB9-2FDFA5DBE2F2_chat’ is wrong ",“code”:0,“details”:{}}}
It already worked but most of the time I cannot connect to a channel and keep stuck in "waitConnection
"
Any idea what I am doing wrong?

Hello @Klaus_Stoller,

we are looking into your issue. Will get back to you as soon as I have some info.

Regards,
Stanislaw

Hello @Klaus_Stoller,

I don’t see the 953073C4-A2F4-40E5-8CB9-2FDFA5DBE2F2_chat channel in your app.
However, this should not cause such errors.
Are you still able to reproduce it? Is it reproduces stably or from time to time?

Regards,
Stanislaw

Hello,
“953073C4-A2F4-40E5-8CB9-2FDFA5DBE2F2_chat” is a dynamically created channel. I managed to connect to these channels most of the time now. But when the phone wakes up from background mode it seems as if the connection gets broken and I need to kill the app and start over again. No chance to reconnect again.
regards

@Klaus_Stoller
Are we talking about the same problem?
In the first post you didn’t mention this…

Hi,

I found a workaround for the first issue. I am creating the channel with REST Api then wait some time. Connect to the channel, wait some time and then add the listeners. Probably not the most elegant way but it seems to work.

But the issue consits when the app is in background mode for an hour or so and the user reopens the app. Then there is no way to reconnect to the channel.

regards

Hi, @Klaus_Stoller

If you believe there is a problem, please create a small reproducible example (project) that recreates the problem you’re experiencing. And provide it with us. We will try to figure out the issue.

Regards.
Marina