Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

sendMessage - iOS Native app - canAccessRoom - Error

Open kormic opened this issue 11 years ago • 5 comments

Hi there, I am trying to send a message through the native ios app that we re building using the objective ddp library.As I see I need to call the sendMessage method. When I do that I get from the callback the error:

Error: Error Domain=Meteor.Error Code=0 "[methods] canAccessRoom -> Cannot access empty room [invalid-room]" UserInfo={NSLocalizedDescription=[methods] canAccessRoom -> Cannot access empty room [invalid-room]}

I am connecting to the demo server and of course before trying to send the message I am logged in and I have joined the general room. Actually I can see my self logged in in the web app (I login using my facebook account on the web app and an other created account in the app).

Any suggestions?

kormic avatar Oct 11 '15 11:10 kormic

@kormic can you confirm / link to the message object you're sending?

geekgonecrazy avatar Oct 13 '15 01:10 geekgonecrazy

invalid-room error is thrown whenever canAccessRoom(rid, userId) is called with rid attribute containing a falsy value, and this value is gathered from the message object passed to sendMessage. Can you confirm which values are you calling this method with?

gmsecrieru avatar Oct 13 '15 12:10 gmsecrieru

I think I found what I was doing wrong. I will get back to you once I m done with it... :)

kormic avatar Oct 13 '15 12:10 kormic

@kormic I think based on you posting successfully that this is now resolved? :+1:

geekgonecrazy avatar Oct 13 '15 15:10 geekgonecrazy

I am sorry for the delay!!! Yes this is resolved!!!

kormic avatar Oct 20 '15 13:10 kormic