void ConnectToJiver() { if (UserMgr.Schedule != null) { Debug.Log("Connecting"); ClearList(); Debug.Log("Cleared"); string appId = "1C0C2894-E73D-4711-B9A0-A55C2C4DEBF6"; // string userId = SystemInfo.deviceUniqueIdentifier; string userName = UserMgr.UserInfo.memberName; string userId = userName; // string channelUrl = DEFAULT_CHANNEL; Jiver.Init(appId); Debug.Log("Init"); Jiver.Login(userId, userName); Debug.Log("Login"); string channelUrl1 = DEFAULT_CHANNEL + UserMgr.Schedule.extend [0].teamCode + UserMgr.Schedule.extend [1].teamCode; string channelUrl2 = DEFAULT_CHANNEL + UserMgr.Schedule.extend [1].teamCode + UserMgr.Schedule.extend [0].teamCode; Debug.Log(channelUrl1 + "," + channelUrl2); Jiver.Join(channelUrl1, channelUrl2); Debug.Log("Join"); Jiver.QueryChannelList(false); Debug.Log("List"); } }
void Connect(string channelUrl) { Debug.Log("Connect to " + channelUrl); ResetContent(); Jiver.Join(channelUrl); Jiver.Connect(50); }
void Start() { string appId = "A7A2672C-AD11-11E4-8DAA-0A18B21C2D82"; string userId = SystemInfo.deviceUniqueIdentifier; string userName = "******" + userId.Substring(0, 5); string channelUrl = "jia_test.Unity3d"; Jiver.Init(appId); Jiver.Login(userId, userName); Jiver.Join(channelUrl); Jiver.Connect(); }
void Start() { // API Token: 95a9676a5e8d1dd421aad0a4e3d6c203752362e4 string appId = "1C0C2894-E73D-4711-B9A0-A55C2C4DEBF6"; string userId = SystemInfo.deviceUniqueIdentifier; string userName = "******" + userId.Substring(0, 5); string channelUrl = "Liveballchat.KTHH"; Jiver.Init(appId); Jiver.Login(userId, userName); Jiver.Join(channelUrl); Jiver.Connect(); }
void DrawChannels(float width, float height) { return; int columns = 4; int rowCount = (int)Mathf.Ceil((float)channels.Count / (float)columns); float rowWidth = width - scrollBarWidth - 1; float buttonHeight = LINE_HEIGHT * 2f; float buttonWidth = rowWidth / columns; float totalHeight = Mathf.Max(height, buttonHeight * rowCount); channelScrollViewVector = GUI.BeginScrollView(new Rect(0, 0, width, height), channelScrollViewVector, new Rect(0, 0, rowWidth, totalHeight), false, true); for (int i = 0; i < channels.Count; i++) { float buttonLeft = i % columns * buttonWidth; float buttonTop = (i / columns) * buttonHeight; Channel channel = channels[i]; if (selectedChannelUrl == channel.GetUrl()) { Color c = GUI.backgroundColor; GUI.backgroundColor = Color.green; if (GUI.Button(new Rect(buttonLeft, buttonTop, buttonWidth, buttonHeight), "#" + channel.GetUrlWithoutAppPrefix())) { tabMode = TAB_MODE.CHAT; } GUI.backgroundColor = c; } else { if (GUI.Button(new Rect(buttonLeft, buttonTop, buttonWidth, buttonHeight), "#" + channel.GetUrlWithoutAppPrefix())) { Jiver.Join(channel.GetUrl()); Jiver.Connect(); messages.Clear(); tabMode = TAB_MODE.CHAT; channelName = "Connecting..."; } } } GUI.EndScrollView(); }