Channel API: private channel ID
Hi!
While am I still in whine mode ;) I'd like to repost my question originally posted here:
[URL="http://dev.widsets.com/forum/topic/7/2082763/1/"]http://dev.widsets.com/forum/topic/7/2082763/1/[/URL]
In client 2.0 it was not possible to use private channel's name as an ID for openChannel(Id,callback) and there was nothing else as a replacement. May I ask for some explanation on how to use private channels properly?
[SIZE="1"](After they are working again, that is.)[/SIZE]
Thanks!
Jerry
Re: Channel API: private channel ID
Channel id (for public channel) can be what ever, but it should have something to do with the name of the widget so that public channel names would not collide (so don't use "default", "channel", "public" etc ;)
To use private channels:
1) User A creates private channel:
openPrivateChannel("foo", [], 10*1000, onPrivateChannelCreated);
2) When onPrivateChannelCreated() is called by platform, User A knows the name of the private channel.getName()
3) User A sends the name to user B via public channel that they are both joined on: Member.send("challenge", ["name" => channel.getName()], onChallengeAgreed);
4) User B gets previous message to his MessageCallback (given when joined to public channel): if (command.equals("challenge")) { openChannel(argument.name, "foo", [], 10*1000, onPrivateChannel); }
Channels should start to work after next release in the beginning of next month =)
/render
Re: Channel API: private channel ID
Hi render,
thanks for thorough explanation, I will test it with the new release for sure :)
Is there a scenario where it would be possible to use shortened version of openChannel function: openChannel(Id, callback)?
Thanks again!
Jerry