public void onCommandReceived(AbstractCommand command) {
			// Filter out the messages we care about
			if (command instanceof GrantedSessionCommand) {
				// Print our our unique key, this will be used for
				// subsequent connections
				Utilities.log("Your instanceId is " + ((GrantedSessionCommand) command).getInstanceId());

				try {
					router.registerCommandSubscriber(this, WidgetCommand.class, WIDGET_ID);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}

				AppChatExample.this.startUserInput();

				//Launch widget
				try {
					AppChatExample.this.router.publishCommand(new WidgetLaunchMethodCommand("callid-launch-" + WIDGET_ID, WIDGET_ID));
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			} else if (command instanceof WidgetCommand) {
				// handle incoming message from a widget
				try {
					JSONObject payload = new JSONObject(command.getPayload());
					String username = payload.getString("username");
					String message = payload.getString("message");
					Utilities.log(username + ": " + message);
				} catch (JSONException e) {
					e.printStackTrace();
				}
			} else { // print out the others for educational purposes
				Utilities.log("Received: " + command.toString());
			}
		}