Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Access CollectionNode when logged in as guest

Avatar

Level 2

Hi,

  I am attempting to do some custom messaging by using the CollectionNode in action script.  When I am logged in as host I can use the collectionNode with no problems, but when I am logged in as a guest (all my users will be 'guests') - I get the error 'insufficient permissions to create a new CollectionNode. You must be an OWNER of the room to add new multi-user features to it. Log in with developer credentials in order to do so.'

  I think the problem is that in my code I have:

private var messaging:CollectionNode = new CollectionNode();

  I have a CollectionNode ( named 'Messaging') for my room, which was created using the room console.  Is there a way I can access this already created CollectionNode through actionscript (jnstead of instantiating a new one)?

  Hope my question makes sense - I am really stuck and probably missing something obvious.  Can anyone help me out?

thanks

Mark

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Mark,

Here is a way to access a collectionnode created using devconsole.

For e.g. Let's say you created a CollectionNode called "myCollectionNode" using devconsole, then the way you can access it as a guest is

private var messaging:CollectionNode = new CollectionNode();

messaging.sharedID = "myCollectionNode" ;

messaging.connectSession = session ;

messaging.subscribe() ;

i.e. you need to assign the name to sharedID property and assign a connectSession object to connectSession property. And then when you call subscribe, you get all the data.

Hope this helps.

Thanks

Hironmay Basu

View solution in original post

0 Replies

Avatar

Correct answer by
Level 10

Hi Mark,

Here is a way to access a collectionnode created using devconsole.

For e.g. Let's say you created a CollectionNode called "myCollectionNode" using devconsole, then the way you can access it as a guest is

private var messaging:CollectionNode = new CollectionNode();

messaging.sharedID = "myCollectionNode" ;

messaging.connectSession = session ;

messaging.subscribe() ;

i.e. you need to assign the name to sharedID property and assign a connectSession object to connectSession property. And then when you call subscribe, you get all the data.

Hope this helps.

Thanks

Hironmay Basu

Avatar

Level 2

Hi Hironmay,

  Thanks that did help!  The issue was that I was not setting the sharedID of the CollectionNode.   It makes sense now that it should be set to the name of the CollectionNode I created in the dev console.

cheers

Mark