Sitelet https://github.com/zongen/java/commit/f59c89b11b90fa2b918632e12bfb2075eea553e3
Skip to content

Commit f59c89b

Browse files
author
Devendra
committed
fixing receiving of JSON objects on psv2
1 parent 7630d98 commit f59c89b

3 files changed

Lines changed: 3778 additions & 5 deletions

File tree

‎java/srcPubnubApi/srcCore/com/pubnub/api/PubnubCoreAsync.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ abstract class PubnubCoreAsync extends PubnubCore implements PubnubAsyncInterfac
3434
private int HEARTBEAT = 320;
3535
private volatile int PRESENCE_HB_INTERVAL = 0;
3636

37-
private boolean V2 = false;
37+
private boolean V2 = true;
3838

3939
public void setV2(boolean v2) {
4040
this.V2 = v2;
@@ -1265,7 +1265,7 @@ void v2Handler(JSONObject jso, HttpRequest hreq) throws JSONException {
12651265
String channel = messageObj.getString("c");
12661266
String sub_channel = (messageObj.isNull("b")) ? null : messageObj.getString("b");
12671267

1268-
String message = messageObj.getString("d");
1268+
Object message = messageObj.get("d");
12691269

12701270
SubscriptionItem chobj = null;
12711271
if (channelSubscriptions != null && sub_channel != null)

‎scala/scala-pubnub-tests/src/tests/scala/com/pubnub/api/tests/publish.scala‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class PublishSpec1 extends fixture.FunSpec with AwaitilitySupport {
6565
}
6666
SSL = Try(test.configMap.getRequired[String]("ssl").asInstanceOf[String].toBoolean).getOrElse(false)
6767
val pubnub = new Pubnub(PUBLISH_KEY, SUBSCRIBE_KEY, SECRET_KEY, CIPHER_KEY, SSL)
68+
//pubnub.setV2(false)
6869
pubnubTestConfig.pubnub = pubnub
6970
withFixture(test.toNoArgTest(pubnubTestConfig))
7071
}
@@ -110,7 +111,7 @@ class PublishSpec1 extends fixture.FunSpec with AwaitilitySupport {
110111
}
111112

112113

113-
it("should be able to publish JSON Array successfully", PublishTest) { pubnubTestConfig =>
114+
it("should be able to publish JSON Array successfully", SingleTest) { pubnubTestConfig =>
114115

115116
var pubnub = pubnubTestConfig.pubnub
116117
var channel = "channel-" + getRandom()
@@ -151,7 +152,7 @@ class PublishSpec1 extends fixture.FunSpec with AwaitilitySupport {
151152

152153
}
153154

154-
it("should be able to publish JSON Array literal string successfully", PublishTest) { pubnubTestConfig =>
155+
it("should be able to publish JSON Array literal string successfully", SingleTest) { pubnubTestConfig =>
155156

156157
var pubnub = pubnubTestConfig.pubnub
157158
var channel = "channel-" + getRandom()
@@ -389,4 +390,4 @@ class PublishSpec1 extends fixture.FunSpec with AwaitilitySupport {
389390

390391

391392
}
392-
}
393+
}

0 commit comments

Comments
 (0)