7. SimpleChat revisited

Now that you have two installations, both connected to a Broker Service, it is time to connect the two:

  • move to the browser window that has your own installation (not your test user profile window)

  • click the Home button;

  • open the Start contexts tab;

  • Double-click My Chats;

  • Create a new chat by clicking the plus-button on the table controls;

  • Open it;

  • Enter a title: "Me to <test1>" (where you replace <test1> with the name of your test installation user).

Notice that under the title Your contacts, a small card is listed. It has the name of the peer that sent you the BrokerService invitation. Don’t use this card, as you’d get into contact with that person!

Instead, click the checkbox I want to invite someone I have no contact card for. A new text field appears. Write "Hello <test1>, let’s Chat". This message will appear in the invitation that test1 will receive, much like the message that appeared in the broker service invitation you used in previous sections.

After you leave this field, you’ll see that the button Download invitation file becomes enabled. Press it. A file called invitation.json is downloaded to your device.

Now move to the browser window that has your test installation (the test profile window). Click the Drop an invitation button on the right side of the MyContexts menu, and press enter. Browse to the invitation.json file and upload it into the test installation.

If you have notifications on, wait till you are notified that model:SimpleChat has been added (assuming you had not added it by hand before). Click the Home button. Open the tab Invitations and then double-click the invitation that is now there. A new window will open, much like the one you have seen before when you connected to the broker service. Accept the invitation by dragging the card. Again, the window changes it appearance as you have now assumed the 'Partner' role in the chat.

7.1. Chat!

Everything has been set up, so start chatting:

  • enter a text in the field after "test1";

  • move to the browser window with your own profile and see that text appear;

  • enter a response in the other field;

  • move back to the test1 profile and see that it is there.

You and your test profile user have succesfully connected and are now exchanging messages through the broker service.