Skip to content

Commit 447b5ac

Browse files
authored
Merge pull request #42 from pubnub/develop
HereNow Deserialization Error fix
2 parents 5ab0d67 + 571df5a commit 447b5ac

File tree

6 files changed

+35
-6
lines changed

6 files changed

+35
-6
lines changed

.pubnub.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
---
22
changelog:
3+
-
4+
changes:
5+
-
6+
text: "HereNow Deserialization Error fix"
7+
type: improvement
8+
date: Feb 5, 19
9+
version: v4.7.3
310
-
411
changes:
512
-
@@ -485,4 +492,4 @@ supported-platforms:
485492
- "Ubuntu 12.04+, with Graphics card DX9 (shader model 3.0) or DX11 with feature level 9.3 capabilities; and CPU SSE2 instruction set support."
486493
- "Mac OS X 10.8+, with Graphics card DX9 (shader model 3.0) or DX11 with feature level 9.3 capabilities; and CPU SSE2 instruction set support."
487494
version: "PubNub Unity SDK"
488-
version: v4.7.2
495+
version: v4.7.3

PubNubUnity/Assets/PubNub/Builders/Presence/HereNowRequestBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ protected bool CreateHereNowResult(object objChannelsDict, out Dictionary<string
201201
}
202202
} else {
203203
Dictionary<string, object>[] dictUuidsState = uuids as Dictionary<string, object>[];
204+
if (dictUuidsState != null){
204205
foreach (Dictionary<string, object> objUuidsState in dictUuidsState){
205206
PNHereNowOccupantData occupantData = new PNHereNowOccupantData();
206207

@@ -220,10 +221,9 @@ protected bool CreateHereNowResult(object objChannelsDict, out Dictionary<string
220221
occupantData.State = objUuidsState;
221222
}
222223
channelData.Occupants.Add(occupantData);
224+
}
223225
}
224226
}
225-
226-
227227
}
228228
}
229229
channelsResult.Add(channelName, channelData);

PubNubUnity/Assets/PubNub/PlayModeTests/PlayModeTests.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,28 @@ public IEnumerator TestTime() {
7878

7979
// pubnub.CleanUp();
8080
// }
81+
82+
[UnityTest]
83+
public IEnumerator TestHereNowEmptyChannel()
84+
{
85+
PNConfiguration pnConfiguration = PlayModeCommon.SetPNConfig(false);
86+
pnConfiguration.UUID = "UnityTestHereNowUUID";
87+
PubNub pubnub = new PubNub(pnConfiguration);
88+
string hereNowChannel = "EmptyChannel";
89+
List<string> channelList = new List<string>() { hereNowChannel };
90+
bool testReturn = false;
91+
92+
pubnub.HereNow().Channels(channelList).IncludeState(true).IncludeUUIDs(true).Async((result, status) =>
93+
{
94+
Debug.Log("status.Error:" + status.Error);
95+
Assert.True(!status.Error);
96+
bool matchResult = MatchHereNowresult(pubnub, result, channelList, pnConfiguration.UUID, true, false, false, 0, false, null);// Check occupancy-> It should be empty
97+
testReturn = !status.Error && matchResult;
98+
});
99+
yield return new WaitForSeconds(PlayModeCommon.WaitTimeBetweenCalls4);
100+
Assert.True(testReturn, "test didn't return");
101+
pubnub.CleanUp();
102+
}
81103

82104
[UnityTest]
83105
public IEnumerator TestHereNowChannels() {

PubNubUnity/Assets/PubNub/PubNubUnity/PubNubUnityBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace PubNubAPI
77
public class PubNubUnityBase
88
{
99
protected Counter publishMessageCounter;
10-
private const string build = "4.7.2";
10+
private const string build = "4.7.3";
1111
private string pnsdkVersion = string.Format ("PubNub-CSharp-Unity/{0}", build);
1212

1313
public string Version {

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Build Status](https://api.travis-ci.org/pubnub/unity.svg?branch=master)](https://travis-ci.org/pubnub/unity) [![Build status](https://ci.appveyor.com/api/projects/status/1p3494pnt6rgqdsm/branch/master?svg=true)](https://ci.appveyor.com/project/PubNub/unity)
44

5-
## PubNub 4.7.2 Web Data Push Cloud-Hosted API for Unity 5+
5+
## PubNub 4.7.3 Web Data Push Cloud-Hosted API for Unity 5+
66
### Supports PC, Mac, Linux, iOS, Android, Windows Store Universal 10 and WebGL
77

88
## All new PubNub Unity SDK

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.7.2
1+
4.7.3

0 commit comments

Comments
 (0)