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

how to create dynamic room in runtime execution?

Avatar

Level 2

Hello All,

Can you please suggest me how can I create dynamic room in runtime execution? I do not want to create fixed room from the room consol. I want to create a new room & also delete it after work complete in runtime execution.

thanks,

krish

1 Reply

Avatar

Employee

Hi Krish,

If you are using your own server to do ExternalAuthentication, then you can

user server to server API's to do that. Please refer to Server2Server apps

in the SDK's sample apps folder.

Else you might have to use AccountManager with room

owner credentials. But the Server2Server aprroach is highly recommended.

                private var acctMgr:AccountManager = new AccountManager();
                acctMgr.accountURL = m_accountURL;
                acctMgr.authenticator = authenticator;
                acctMgr.addEventListener(AccountManagerEvent.LOGIN_SUCCESS, authenticateSuccess);
                //acctMgr.addEventListener(AccountManagerEvent.LOGIN_FAILURE, authenticateFailure);
                //acctMgr.addEventListener(AccountManagerEvent.ACCESS_ERROR, onAuthenticationAccessError);
                   
                public function authenticateSuccess(event:AccountManagerEvent):void {
                   acctMgr.addEventListener(AccountManagerEvent.ROOM_DELETE, onRoomDelete);
                   acctMgr.deleteRoom(name, template);
                }
               
                public function onRoomDelete(event:AccountManagerEvent):void {

                }

Thanks

Arun