From e045c42357acbf20529093694f4ea450567d8219 Mon Sep 17 00:00:00 2001 From: "marcin.cebo" Date: Tue, 28 Oct 2025 16:46:01 +0100 Subject: [PATCH 1/4] Removed possibility to use deprecated PushType MPNS - Microsoft Push Notification Service. Added deprecation warning for old APNS PushType. In case FCM is chosen as PushType type REST query param gets fcm value instead of gcm. --- examples/basic_usage/mobile_push.php | 4 +- phpstan-baseline.neon | 40 ------ src/PubNub/Endpoints/Push/PushEndpoint.php | 6 +- src/PubNub/Enums/PNPushType.php | 15 +- .../functional/push/AddChannelsToPushTest.php | 6 +- .../push/ListPushProvisionsTest.php | 24 +--- .../push/RemoveChannelsFromPushTest.php | 6 +- .../push/RemoveDeviceFromPushTest.php | 24 +--- .../integrational/ListPushProvisionsTest.php | 37 ++--- .../ModifyPushChannelsForDeviceTest.php | 132 ++++-------------- .../push/AddChannelsToPushEndpointTest.php | 2 +- .../push/ListPushProvisionsEndpointTest.php | 105 ++++++++------ .../RemoveChannelsFromPushEndpointTest.php | 72 +++++++++- .../push/RemoveDeviceFromPushEndpointTest.php | 92 ++++++------ 14 files changed, 248 insertions(+), 317 deletions(-) diff --git a/examples/basic_usage/mobile_push.php b/examples/basic_usage/mobile_push.php index 4413442f..ec0c0a5b 100644 --- a/examples/basic_usage/mobile_push.php +++ b/examples/basic_usage/mobile_push.php @@ -20,13 +20,13 @@ // Define channels to enable push notifications on $channelsForPush = ["news", "alerts", "promotions"]; -// FCM/GCM device token (typically a long string generated by Firebase) +// FCM device token (typically a long string generated by Firebase) $deviceId = "fcm-device-registration-token-from-firebase"; try { // Register the device to receive push notifications on the specified channels $result = $pubnub->addChannelsToPush() - ->pushType(PNPushType::FCM) // Use GCM/FCM for Android devices + ->pushType(PNPushType::FCM) // Use FCM for Android devices ->channels($channelsForPush) ->deviceId($deviceId) ->sync(); diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index c15ef490..ac342936 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -5740,11 +5740,6 @@ parameters: count: 1 path: tests/functional/push/ListPushProvisionsTest.php - - - message: "#^Method Tests\\\\Functional\\\\Push\\\\ListPushProvisionsTest\\:\\:testListChannelGroupMPNS\\(\\) has no return type specified\\.$#" - count: 1 - path: tests/functional/push/ListPushProvisionsTest.php - - message: "#^Method Tests\\\\Functional\\\\Push\\\\RemoveChannelsFromPushExposed\\:\\:buildParams\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -5780,11 +5775,6 @@ parameters: count: 1 path: tests/functional/push/RemoveDeviceFromPushTest.php - - - message: "#^Method Tests\\\\Functional\\\\Push\\\\RemoveDeviceFromPushTest\\:\\:testRemovePushMPNS\\(\\) has no return type specified\\.$#" - count: 1 - path: tests/functional/push/RemoveDeviceFromPushTest.php - - message: "#^Method Tests\\\\Integrational\\\\AddChannelChannelGroupEndpointTest\\:\\:testChannelMissing\\(\\) has no return type specified\\.$#" count: 1 @@ -6130,11 +6120,6 @@ parameters: count: 1 path: tests/integrational/ListPushProvisionsTest.php - - - message: "#^Method Tests\\\\Integrational\\\\Push\\\\ListPushProvisionsTest\\:\\:testMicrosoftSuccess\\(\\) has no return type specified\\.$#" - count: 1 - path: tests/integrational/ListPushProvisionsTest.php - - message: "#^Method Tests\\\\Integrational\\\\Push\\\\ListPushProvisionsTest\\:\\:testNullDeviceId\\(\\) has no return type specified\\.$#" count: 1 @@ -6170,11 +6155,6 @@ parameters: count: 1 path: tests/integrational/ModifyPushChannelsForDeviceTest.php - - - message: "#^Method Tests\\\\Integrational\\\\Push\\\\ModifyPushChannelsForDeviceTest\\:\\:testAddMicrosoftSuccessSync\\(\\) has no return type specified\\.$#" - count: 1 - path: tests/integrational/ModifyPushChannelsForDeviceTest.php - - message: "#^Method Tests\\\\Integrational\\\\Push\\\\ModifyPushChannelsForDeviceTest\\:\\:testAppleSuccessRemove\\(\\) has no return type specified\\.$#" count: 1 @@ -6240,16 +6220,6 @@ parameters: count: 1 path: tests/integrational/ModifyPushChannelsForDeviceTest.php - - - message: "#^Method Tests\\\\Integrational\\\\Push\\\\ModifyPushChannelsForDeviceTest\\:\\:testMicrosoftSuccessRemove\\(\\) has no return type specified\\.$#" - count: 1 - path: tests/integrational/ModifyPushChannelsForDeviceTest.php - - - - message: "#^Method Tests\\\\Integrational\\\\Push\\\\ModifyPushChannelsForDeviceTest\\:\\:testMicrosoftSuccessRemoveAll\\(\\) has no return type specified\\.$#" - count: 1 - path: tests/integrational/ModifyPushChannelsForDeviceTest.php - - message: "#^Method Tests\\\\Integrational\\\\Push\\\\ModifyPushChannelsForDeviceTest\\:\\:testMissingChannels\\(\\) has no return type specified\\.$#" count: 1 @@ -7025,11 +6995,6 @@ parameters: count: 1 path: tests/integrational/push/ListPushProvisionsEndpointTest.php - - - message: "#^Method Tests\\\\Integrational\\\\Push\\\\ListPushProvisionsEndpointTest\\:\\:testListChannelGroupMPNS\\(\\) has no return type specified\\.$#" - count: 1 - path: tests/integrational/push/ListPushProvisionsEndpointTest.php - - message: "#^Method Tests\\\\Integrational\\\\Push\\\\ListPushProvisionsEndpointTest\\:\\:testWarningWhenUsingDeprecatedGCMType\\(\\) has no return type specified\\.$#" count: 1 @@ -7070,11 +7035,6 @@ parameters: count: 1 path: tests/integrational/push/RemoveDeviceFromPushEndpointTest.php - - - message: "#^Method Tests\\\\Integrational\\\\Push\\\\RemoveDeviceFromPushEndpointTest\\:\\:testRemovePushMPNS\\(\\) has no return type specified\\.$#" - count: 1 - path: tests/integrational/push/RemoveDeviceFromPushEndpointTest.php - - message: "#^Method Tests\\\\Integrational\\\\Push\\\\RemoveDeviceFromPushEndpointTest\\:\\:testWarningWhenUsingDeprecatedGCMType\\(\\) has no return type specified\\.$#" count: 1 diff --git a/src/PubNub/Endpoints/Push/PushEndpoint.php b/src/PubNub/Endpoints/Push/PushEndpoint.php index 767e4e31..fe9536cd 100644 --- a/src/PubNub/Endpoints/Push/PushEndpoint.php +++ b/src/PubNub/Endpoints/Push/PushEndpoint.php @@ -66,6 +66,10 @@ protected function validatePushType() trigger_error("GCM is deprecated. Please use FCM instead.", E_USER_DEPRECATED); } + if ($this->pushType === PNPushType::APNS) { + trigger_error("APNS is deprecated. Please use APNS2 instead.", E_USER_DEPRECATED); + } + if (!in_array($this->pushType, PNPushType::all())) { throw new PubNubValidationException("Invalid push type"); } @@ -149,6 +153,6 @@ protected function getName() protected function getPushType(): string { - return $this->pushType == PNPushType::FCM ? 'gcm' : $this->pushType; + return $this->pushType == PNPushType::FCM ? 'fcm' : $this->pushType; } } diff --git a/src/PubNub/Enums/PNPushType.php b/src/PubNub/Enums/PNPushType.php index ee981c81..af86f91f 100644 --- a/src/PubNub/Enums/PNPushType.php +++ b/src/PubNub/Enums/PNPushType.php @@ -4,18 +4,25 @@ class PNPushType { - public const APNS = "apns"; + public const APNS2 = "apns2"; - public const MPNS = "mpns"; - public const GCM = "gcm"; public const FCM = "fcm"; + /** + * @deprecated Use APNS2 instead. APNS will be removed in a future version. + */ + public const APNS = "apns"; + + /** + * @deprecated Use FCM instead. GCM will be removed in a future version. + */ + public const GCM = "gcm"; + public static function all() { return [ self::APNS, self::APNS2, - self::MPNS, self::GCM, self::FCM ]; diff --git a/tests/functional/push/AddChannelsToPushTest.php b/tests/functional/push/AddChannelsToPushTest.php index 71e9f34c..eecad467 100644 --- a/tests/functional/push/AddChannelsToPushTest.php +++ b/tests/functional/push/AddChannelsToPushTest.php @@ -43,7 +43,7 @@ public function testPushAddMultipleChannels() $add = new AddChannelsToPushExposed($this->pubnub); $add->channels(["ch1", "ch2"]) - ->pushType(PNPushType::MPNS) + ->pushType(PNPushType::FCM) ->deviceId("coolDevice"); $this->assertEquals(sprintf( @@ -55,7 +55,7 @@ public function testPushAddMultipleChannels() $this->assertEquals([ "pnsdk" => PubNubUtil::urlEncode(PubNub::getSdkFullName()), "uuid" => $this->pubnub->getConfiguration()->getUuid(), - "type" => "mpns", + "type" => "fcm", "add" => "ch1,ch2" ], $add->buildParams()); @@ -110,7 +110,7 @@ public function testPushAddFCM() $this->assertEquals([ "pnsdk" => PubNubUtil::urlEncode(PubNub::getSdkFullName()), "uuid" => $this->pubnub->getConfiguration()->getUuid(), - "type" => "gcm", + "type" => "fcm", "add" => "ch1,ch2,ch3" ], $add->buildParams()); diff --git a/tests/functional/push/ListPushProvisionsTest.php b/tests/functional/push/ListPushProvisionsTest.php index f3d0de1f..35e01192 100644 --- a/tests/functional/push/ListPushProvisionsTest.php +++ b/tests/functional/push/ListPushProvisionsTest.php @@ -75,29 +75,7 @@ public function testListChannelGroupFCM() $this->assertEquals([ "pnsdk" => PubNubUtil::urlEncode(PubNub::getSdkFullName()), "uuid" => $this->pubnub->getConfiguration()->getUuid(), - "type" => "gcm" - ], $list->buildParams()); - } - - public function testListChannelGroupMPNS() - { - $this->pubnub->getConfiguration()->setUuid("sampleUUID"); - - $list = new ListPushProvisionsExposed($this->pubnub); - - $list->pushType(PNPushType::MPNS) - ->deviceId("coolDevice"); - - $this->assertEquals(sprintf( - ListPushProvisions::PATH, - $this->pubnub->getConfiguration()->getSubscribeKey(), - "coolDevice" - ), $list->buildPath()); - - $this->assertEquals([ - "pnsdk" => PubNubUtil::urlEncode(PubNub::getSdkFullName()), - "uuid" => $this->pubnub->getConfiguration()->getUuid(), - "type" => "mpns" + "type" => "fcm" ], $list->buildParams()); } } diff --git a/tests/functional/push/RemoveChannelsFromPushTest.php b/tests/functional/push/RemoveChannelsFromPushTest.php index d801d13d..ea8a395f 100644 --- a/tests/functional/push/RemoveChannelsFromPushTest.php +++ b/tests/functional/push/RemoveChannelsFromPushTest.php @@ -41,7 +41,7 @@ public function testPushRemoveMultipleChannels() $remove = new RemoveChannelsFromPushExposed($this->pubnub); $remove->channels(['ch1', 'ch2']) - ->pushType(PNPushType::MPNS) + ->pushType(PNPushType::FCM) ->deviceId('coolDevice'); $this->assertEquals(sprintf( @@ -53,7 +53,7 @@ public function testPushRemoveMultipleChannels() $this->assertEquals([ "pnsdk" => PubNubUtil::urlEncode(PubNub::getSdkFullName()), "uuid" => $this->pubnub->getConfiguration()->getUuid(), - "type" => "mpns", + "type" => "fcm", "remove" => "ch1,ch2" ], $remove->buildParams()); } @@ -77,7 +77,7 @@ public function testPushRemoveFCM() $this->assertEquals([ "pnsdk" => PubNubUtil::urlEncode(PubNub::getSdkFullName()), "uuid" => $this->pubnub->getConfiguration()->getUuid(), - "type" => "gcm", + "type" => "fcm", "remove" => "ch1,ch2,ch3" ], $remove->buildParams()); } diff --git a/tests/functional/push/RemoveDeviceFromPushTest.php b/tests/functional/push/RemoveDeviceFromPushTest.php index 02c6dd80..03d9e990 100644 --- a/tests/functional/push/RemoveDeviceFromPushTest.php +++ b/tests/functional/push/RemoveDeviceFromPushTest.php @@ -32,28 +32,6 @@ public function testRemovePushAPNS() ], $remove->buildParams()); } - public function testRemovePushMPNS() - { - $this->pubnub->getConfiguration()->setUuid("sampleUUID"); - - $remove = new RemoveDeviceFromPushExposed($this->pubnub); - - $remove->pushType(PNPushType::MPNS) - ->deviceId('coolDevice'); - - $this->assertEquals(sprintf( - RemoveDeviceFromPush::PATH, - $this->pubnub->getConfiguration()->getSubscribeKey(), - "coolDevice" - ), $remove->buildPath()); - - $this->assertEquals([ - "pnsdk" => PubNubUtil::urlEncode(PubNub::getSdkFullName()), - "uuid" => $this->pubnub->getConfiguration()->getUuid(), - "type" => "mpns", - ], $remove->buildParams()); - } - public function testRemovePushFCM() { $this->pubnub->getConfiguration()->setUuid("sampleUUID"); @@ -72,7 +50,7 @@ public function testRemovePushFCM() $this->assertEquals([ "pnsdk" => PubNubUtil::urlEncode(PubNub::getSdkFullName()), "uuid" => $this->pubnub->getConfiguration()->getUuid(), - "type" => "gcm", + "type" => "fcm", ], $remove->buildParams()); } } diff --git a/tests/integrational/ListPushProvisionsTest.php b/tests/integrational/ListPushProvisionsTest.php index 2bd332c9..7d22b866 100644 --- a/tests/integrational/ListPushProvisionsTest.php +++ b/tests/integrational/ListPushProvisionsTest.php @@ -36,7 +36,7 @@ public function testFCMSuccess() $list->stubFor("/v1/push/sub-key/demo/devices/coolDevice") ->withQuery([ - "type" => "gcm", + "type" => "fcm", "pnsdk" => $this->encodedSdkName, "uuid" => $this->pubnub_demo->getConfiguration()->getUuid(), ]) @@ -49,25 +49,6 @@ public function testFCMSuccess() $this->assertInstanceOf(\PubNub\Models\Consumer\Push\PNPushListProvisionsResult::class, $response); } - public function testMicrosoftSuccess() - { - $list = new ListPushProvisionsExposed($this->pubnub_demo); - - $list->stubFor("/v1/push/sub-key/demo/devices/coolDevice") - ->withQuery([ - "type" => "mpns", - "pnsdk" => $this->encodedSdkName, - "uuid" => $this->pubnub_demo->getConfiguration()->getUuid(), - ]) - ->setResponseBody("[\"ch1\", \"ch2\", \"ch3\"]"); - - $response = $response = $list->deviceId("coolDevice") - ->pushType(PNPushType::MPNS) - ->sync(); - - $this->assertInstanceOf(\PubNub\Models\Consumer\Push\PNPushListProvisionsResult::class, $response); - } - public function testIsAuthRequiredSuccess() { $config = $this->config->clone(); @@ -79,9 +60,10 @@ public function testIsAuthRequiredSuccess() $pubnub = new PubNub($config); $list = new ListPushProvisionsExposed($pubnub); - $list->stubFor("/v1/push/sub-key/demo/devices/coolDevice") + $list->stubFor("/v2/push/sub-key/demo/devices-apns2/coolDevice") ->withQuery([ - "type" => "mpns", + "topic" => "coolTopic", + "environment" => "development", "pnsdk" => $this->encodedSdkName, "uuid" => $this->pubnub_demo->getConfiguration()->getUuid(), "auth" => "myKey", @@ -89,7 +71,8 @@ public function testIsAuthRequiredSuccess() ->setResponseBody("[\"ch1\", \"ch2\", \"ch3\"]"); $response = $list->deviceId("coolDevice") - ->pushType(PNPushType::MPNS) + ->pushType(PNPushType::APNS2) + ->topic( "coolTopic") ->sync(); $this->assertInstanceOf(\PubNub\Models\Consumer\Push\PNPushListProvisionsResult::class, $response); @@ -104,7 +87,7 @@ public function testNullSubscribeKey() $list = new ListPushProvisionsExposed($pubnub); $list->deviceId("coolDevice") - ->pushType(PNPushType::MPNS) + ->pushType(PNPushType::FCM) ->sync(); } @@ -119,7 +102,7 @@ public function testEmptySubscribeKey() $list = new ListPushProvisionsExposed($pubnub); $list->deviceId("coolDevice") - ->pushType(PNPushType::MPNS) + ->pushType(PNPushType::FCM) ->sync(); } @@ -141,7 +124,7 @@ public function testNullDeviceId() $list = new ListPushProvisionsExposed($this->pubnub_demo); - $list->pushType(PNPushType::MPNS) + $list->pushType(PNPushType::FCM) ->sync(); } @@ -153,7 +136,7 @@ public function testEmptyDeviceIdRemoveAll() $list = new ListPushProvisionsExposed($this->pubnub_demo); $list->deviceId("") - ->pushType(PNPushType::MPNS) + ->pushType(PNPushType::APNS2) ->sync(); } } diff --git a/tests/integrational/ModifyPushChannelsForDeviceTest.php b/tests/integrational/ModifyPushChannelsForDeviceTest.php index 96822c52..17e9848f 100644 --- a/tests/integrational/ModifyPushChannelsForDeviceTest.php +++ b/tests/integrational/ModifyPushChannelsForDeviceTest.php @@ -51,7 +51,7 @@ public function testFCMSuccessRemoveAll() $listRemove->stubFor("/v1/push/sub-key/demo/devices/coolDevice/remove") ->withQuery([ - "type" => "gcm", + "type" => "fcm", "pnsdk" => $this->encodedSdkName, "uuid" => "sampleUUID" ]) @@ -64,31 +64,6 @@ public function testFCMSuccessRemoveAll() $this->assertInstanceOf(\PubNub\Models\Consumer\Push\PNPushRemoveAllChannelsResult::class, $response); } - public function testMicrosoftSuccessRemoveAll() - { - $config = new PNConfiguration(); - $config->setSubscribeKey("demo"); - $config->setPublishKey("demo"); - $config->setUuid("sampleUUID"); - $pubnub = new PubNub($config); - - $listRemove = new RemoveChannelsFromPushTestExposed($pubnub); - - $listRemove->stubFor("/v1/push/sub-key/demo/devices/coolDevice/remove") - ->withQuery([ - "type" => "mpns", - "pnsdk" => $this->encodedSdkName, - "uuid" => "sampleUUID" - ]) - ->setResponseBody("[1, \"Modified Channels\"]"); - - $response = $listRemove->pushType(PNPushType::MPNS) - ->deviceId("coolDevice") - ->sync(); - - $this->assertInstanceOf(\PubNub\Models\Consumer\Push\PNPushRemoveAllChannelsResult::class, $response); - } - public function testIsAuthRequiredSuccessRemoveAll() { $config = new PNConfiguration(); @@ -100,17 +75,19 @@ public function testIsAuthRequiredSuccessRemoveAll() $listRemove = new RemoveChannelsFromPushTestExposed($pubnub); - $listRemove->stubFor("/v1/push/sub-key/demo/devices/coolDevice/remove") + $listRemove->stubFor("/v2/push/sub-key/demo/devices-apns2/coolDevice/remove") ->withQuery([ - "type" => "mpns", + "topic" => "coolTopic", + "environment" => "development", "pnsdk" => $this->encodedSdkName, "uuid" => "sampleUUID", "auth" => "myKey", ]) ->setResponseBody("[1, \"Modified Channels\"]"); - $response = $listRemove->pushType(PNPushType::MPNS) + $response = $listRemove->pushType(PNPushType::APNS2) ->deviceId("coolDevice") + ->topic("coolTopic") ->sync(); $this->assertInstanceOf(\PubNub\Models\Consumer\Push\PNPushRemoveAllChannelsResult::class, $response); @@ -128,7 +105,7 @@ public function testNullSubscribeKeyRemoveAll() $listRemove = new RemoveChannelsFromPushTestExposed($pubnub); - $listRemove->pushType(PNPushType::MPNS) + $listRemove->pushType(PNPushType::APNS2) ->deviceId("coolDevice") ->sync(); } @@ -147,7 +124,7 @@ public function testEmptySubscribeKeyRemoveAll() $listRemove = new RemoveChannelsFromPushTestExposed($pubnub); - $listRemove->pushType(PNPushType::MPNS) + $listRemove->pushType(PNPushType::FCM) ->deviceId("coolDevice") ->sync(); } @@ -182,7 +159,7 @@ public function testNullDeviceIdRemoveAll() $listRemove = new RemoveChannelsFromPushTestExposed($pubnub); - $listRemove->pushType(PNPushType::MPNS) + $listRemove->pushType(PNPushType::FCM) ->sync(); } @@ -199,7 +176,7 @@ public function testEmptyDeviceIdRemoveAll() $listRemove = new RemoveChannelsFromPushTestExposed($pubnub); - $listRemove->pushType(PNPushType::MPNS) + $listRemove->pushType(PNPushType::FCM) ->deviceId("") ->sync(); } @@ -244,7 +221,7 @@ public function testAddFCMSuccessSync() $listAdd->stubFor("/v1/push/sub-key/demo/devices/coolDevice") ->withQuery([ "add" => "ch1,ch2,ch3", - "type" => "gcm", + "type" => "fcm", "pnsdk" => $this->encodedSdkName, "uuid" => "sampleUUID" ]) @@ -258,33 +235,6 @@ public function testAddFCMSuccessSync() $this->assertInstanceOf(\PubNub\Models\Consumer\Push\PNPushAddChannelResult::class, $response); } - public function testAddMicrosoftSuccessSync() - { - $config = new PNConfiguration(); - $config->setSubscribeKey("demo"); - $config->setPublishKey("demo"); - $config->setUuid("sampleUUID"); - $pubnub = new PubNub($config); - - $listAdd = new AddChannelsToPushExposed($pubnub); - - $listAdd->stubFor("/v1/push/sub-key/demo/devices/coolDevice") - ->withQuery([ - "add" => "ch1,ch2,ch3", - "type" => "mpns", - "pnsdk" => $this->encodedSdkName, - "uuid" => "sampleUUID" - ]) - ->setResponseBody("[1, \"Modified Channels\"]"); - - $response = $listAdd->pushType(PNPushType::MPNS) - ->channels(["ch1", "ch2", "ch3"]) - ->deviceId("coolDevice") - ->sync(); - - $this->assertInstanceOf(\PubNub\Models\Consumer\Push\PNPushAddChannelResult::class, $response); - } - public function testIsAuthRequiredSuccessAdd() { $config = new PNConfiguration(); @@ -299,14 +249,14 @@ public function testIsAuthRequiredSuccessAdd() $listAdd->stubFor("/v1/push/sub-key/demo/devices/coolDevice") ->withQuery([ "add" => "ch1,ch2,ch3", - "type" => "mpns", + "type" => "fcm", "pnsdk" => $this->encodedSdkName, "uuid" => "sampleUUID", "auth" => "myKey", ]) ->setResponseBody("[1, \"Modified Channels\"]"); - $response = $listAdd->pushType(PNPushType::MPNS) + $response = $listAdd->pushType(PNPushType::FCM) ->channels(["ch1", "ch2", "ch3"]) ->deviceId("coolDevice") ->sync(); @@ -327,7 +277,7 @@ public function testNullSubscribeKeyAdd() $listAdd = new AddChannelsToPushExposed($pubnub); - $listAdd->pushType(PNPushType::MPNS) + $listAdd->pushType(PNPushType::FCM) ->channels(["ch1", "ch2", "ch3"]) ->deviceId("coolDevice") ->sync(); @@ -345,7 +295,7 @@ public function testEmptySubscribeKeyAdd() $pubnub = new PubNub($config); $listAdd = new AddChannelsToPushExposed($pubnub); - $listAdd->pushType(PNPushType::MPNS) + $listAdd->pushType(PNPushType::APNS2) ->channels(["ch1", "ch2", "ch3"]) ->deviceId("coolDevice") ->sync(); @@ -380,7 +330,7 @@ public function testNullDeviceIdAdd() $pubnub = new PubNub($config); $listAdd = new AddChannelsToPushExposed($pubnub); - $listAdd->pushType(PNPushType::MPNS) + $listAdd->pushType(PNPushType::FCM) ->channels(["ch1", "ch2", "ch3"]) ->sync(); } @@ -397,7 +347,7 @@ public function testEmptyDeviceIdAdd() $pubnub = new PubNub($config); $listAdd = new AddChannelsToPushExposed($pubnub); - $listAdd->pushType(PNPushType::MPNS) + $listAdd->pushType(PNPushType::FCM) ->channels(["ch1", "ch2", "ch3"]) ->deviceId("") ->sync(); @@ -415,7 +365,7 @@ public function testMissingChannelsAdd() $pubnub = new PubNub($config); $listAdd = new AddChannelsToPushExposed($pubnub); - $listAdd->pushType(PNPushType::MPNS) + $listAdd->pushType(PNPushType::FCM) ->deviceId("Example") ->sync(); } @@ -458,7 +408,7 @@ public function testFCMSuccessRemove() $remove->stubFor("/v1/push/sub-key/demo/devices/coolDevice") ->withQuery([ "remove" => "ch1,ch2,ch3", - "type" => "gcm", + "type" => "fcm", "pnsdk" => $this->encodedSdkName, "uuid" => "sampleUUID" ]) @@ -472,32 +422,6 @@ public function testFCMSuccessRemove() $this->assertInstanceOf(\PubNub\Models\Consumer\Push\PNPushRemoveChannelResult::class, $response); } - public function testMicrosoftSuccessRemove() - { - $config = new PNConfiguration(); - $config->setSubscribeKey("demo"); - $config->setPublishKey("demo"); - $config->setUuid("sampleUUID"); - $pubnub = new PubNub($config); - $remove = new RemovePushNotificationsFromChannelsExposed($pubnub); - - $remove->stubFor("/v1/push/sub-key/demo/devices/coolDevice") - ->withQuery([ - "remove" => "ch1,ch2,ch3", - "type" => "mpns", - "pnsdk" => $this->encodedSdkName, - "uuid" => "sampleUUID" - ]) - ->setResponseBody("[1, \"Modified Channels\"]"); - - $response = $remove->pushType(PNPushType::MPNS) - ->channels(["ch1", "ch2", "ch3"]) - ->deviceId("coolDevice") - ->sync(); - - $this->assertInstanceOf(\PubNub\Models\Consumer\Push\PNPushRemoveChannelResult::class, $response); - } - public function testIsAuthRequiredSuccessRemove() { $config = new PNConfiguration(); @@ -508,19 +432,21 @@ public function testIsAuthRequiredSuccessRemove() $pubnub = new PubNub($config); $remove = new RemovePushNotificationsFromChannelsExposed($pubnub); - $remove->stubFor("/v1/push/sub-key/demo/devices/coolDevice") + $remove->stubFor("/v2/push/sub-key/demo/devices-apns2/coolDevice") ->withQuery([ "remove" => "ch1,ch2,ch3", - "type" => "mpns", + "topic" => "coolTopic", + "environment" => "development", "pnsdk" => $this->encodedSdkName, "uuid" => "sampleUUID", "auth" => "myKey", ]) ->setResponseBody("[1, \"Modified Channels\"]"); - $response = $remove->pushType(PNPushType::MPNS) + $response = $remove->pushType(PNPushType::APNS2) ->channels(["ch1", "ch2", "ch3"]) ->deviceId("coolDevice") + ->topic("coolTopic") ->sync(); $this->assertInstanceOf(\PubNub\Models\Consumer\Push\PNPushRemoveChannelResult::class, $response); @@ -538,7 +464,7 @@ public function testNullSubscribeKeyRemove() $pubnub = new PubNub($config); $remove = new RemovePushNotificationsFromChannelsExposed($pubnub); - $remove->pushType(PNPushType::MPNS) + $remove->pushType(PNPushType::FCM) ->channels(["ch1", "ch2", "ch3"]) ->deviceId("coolDevice") ->sync(); @@ -558,7 +484,7 @@ public function testEmptySubscribeKeyRemove() $remove = new RemovePushNotificationsFromChannelsExposed($pubnub); - $remove->pushType(PNPushType::MPNS) + $remove->pushType(PNPushType::FCM) ->channels(["ch1", "ch2", "ch3"]) ->deviceId("coolDevice") ->sync(); @@ -587,7 +513,7 @@ public function testNullDeviceId() $remove = new RemovePushNotificationsFromChannelsExposed($this->pubnub); - $remove->pushType(PNPushType::MPNS) + $remove->pushType(PNPushType::FCM) ->channels(["ch1", "ch2", "ch3"]) ->sync(); } @@ -604,7 +530,7 @@ public function testEmptyDeviceId() $pubnub = new PubNub($config); $remove = new RemovePushNotificationsFromChannelsExposed($pubnub); - $remove->pushType(PNPushType::MPNS) + $remove->pushType(PNPushType::FCM) ->channels(["ch1", "ch2", "ch3"]) ->deviceId("") ->sync(); @@ -622,7 +548,7 @@ public function testMissingChannels() $pubnub = new PubNub($config); $remove = new RemovePushNotificationsFromChannelsExposed($pubnub); - $remove->pushType(PNPushType::MPNS) + $remove->pushType(PNPushType::FCM) ->deviceId("") ->sync(); } diff --git a/tests/integrational/push/AddChannelsToPushEndpointTest.php b/tests/integrational/push/AddChannelsToPushEndpointTest.php index cb5b149c..e5c6abbd 100644 --- a/tests/integrational/push/AddChannelsToPushEndpointTest.php +++ b/tests/integrational/push/AddChannelsToPushEndpointTest.php @@ -106,7 +106,7 @@ public function testPushAddFCM() ->withQuery([ "pnsdk" => $this->encodedSdkName, "add" => "ch1,ch2,ch3", - "type" => "gcm", + "type" => "fcm", "uuid" => "sampleUUID", ]) ->setResponseBody('[1, "Modified Channels"]'); diff --git a/tests/integrational/push/ListPushProvisionsEndpointTest.php b/tests/integrational/push/ListPushProvisionsEndpointTest.php index 3ed1d19b..f6728c24 100644 --- a/tests/integrational/push/ListPushProvisionsEndpointTest.php +++ b/tests/integrational/push/ListPushProvisionsEndpointTest.php @@ -75,7 +75,7 @@ public function testListChannelGroupFCM() $list->stubFor("/v1/push/sub-key/demo/devices/coolDevice") ->withQuery([ "pnsdk" => $this->encodedSdkName, - "type" => "gcm", + "type" => "fcm", "uuid" => "sampleUUID", ]) ->setResponseBody('[1, "Modified Channels"]'); @@ -87,59 +87,74 @@ public function testListChannelGroupFCM() $this->assertNotEmpty($result); } - public function testListChannelGroupMPNS() + public function testWarningWhenUsingDeprecatedGCMType() { - $config = new PNConfiguration(); - $config->setSubscribeKey("demo"); - $config->setPublishKey("demo"); - $config->setUuid("sampleUUID"); - $pubnub = new PubNub($config); - $list = new ListPushProvisionsEndpointExposed($pubnub); - - $list->stubFor("/v1/push/sub-key/demo/devices/coolDevice") - ->withQuery([ - "pnsdk" => $this->encodedSdkName, - "type" => "mpns", - "uuid" => "sampleUUID", - ]) - ->setResponseBody('[1, "Modified Channels"]'); - - $result = $list->pushType(PNPushType::MPNS) - ->deviceId("coolDevice") - ->sync(); + set_error_handler(static function (int $errno, string $errstr): never { + throw new \Exception($errstr, $errno); + }, E_USER_DEPRECATED); - $this->assertNotEmpty($result); + try { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('GCM is deprecated. Please use FCM instead.'); + + $config = new PNConfiguration(); + $config->setSubscribeKey("demo"); + $config->setPublishKey("demo"); + $config->setUuid("sampleUUID"); + $pubnub = new PubNub($config); + $list = new ListPushProvisionsEndpointExposed($pubnub); + + $list->stubFor("/v1/push/sub-key/demo/devices/coolDevice") + ->withQuery([ + "pnsdk" => $this->encodedSdkName, + "type" => "gcm", + "uuid" => "sampleUUID", + ]) + ->setResponseBody('[1, "Modified Channels"]'); + + $result = $list->pushType(PNPushType::GCM) + ->deviceId("coolDevice") + ->sync(); + + $this->assertNotEmpty($result); + } finally { + restore_error_handler(); + } } - public function testWarningWhenUsingDeprecatedGCMType() + public function testWarningWhenUsingDeprecatedAPNSType() { set_error_handler(static function (int $errno, string $errstr): never { throw new \Exception($errstr, $errno); }, E_USER_DEPRECATED); - $this->expectException(\Exception::class); - $this->expectExceptionMessage('GCM is deprecated. Please use FCM instead.'); - - $config = new PNConfiguration(); - $config->setSubscribeKey("demo"); - $config->setPublishKey("demo"); - $config->setUuid("sampleUUID"); - $pubnub = new PubNub($config); - $list = new ListPushProvisionsEndpointExposed($pubnub); - - $list->stubFor("/v1/push/sub-key/demo/devices/coolDevice") - ->withQuery([ - "pnsdk" => $this->encodedSdkName, - "type" => "gcm", - "uuid" => "sampleUUID", - ]) - ->setResponseBody('[1, "Modified Channels"]'); - - $result = $list->pushType(PNPushType::GCM) - ->deviceId("coolDevice") - ->sync(); - - $this->assertNotEmpty($result); + try { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('APNS is deprecated. Please use APNS2 instead.'); + + $config = new PNConfiguration(); + $config->setSubscribeKey("demo"); + $config->setPublishKey("demo"); + $config->setUuid("sampleUUID"); + $pubnub = new PubNub($config); + $list = new ListPushProvisionsEndpointExposed($pubnub); + + $list->stubFor("/v1/push/sub-key/demo/devices/coolDevice") + ->withQuery([ + "pnsdk" => $this->encodedSdkName, + "type" => "apns", + "uuid" => "sampleUUID", + ]) + ->setResponseBody('[1, "Modified Channels"]'); + + $result = $list->pushType(PNPushType::APNS) + ->deviceId("coolDevice") + ->sync(); + + $this->assertNotEmpty($result); + } finally { + restore_error_handler(); + } } } diff --git a/tests/integrational/push/RemoveChannelsFromPushEndpointTest.php b/tests/integrational/push/RemoveChannelsFromPushEndpointTest.php index ee90315a..b1c4ceff 100644 --- a/tests/integrational/push/RemoveChannelsFromPushEndpointTest.php +++ b/tests/integrational/push/RemoveChannelsFromPushEndpointTest.php @@ -66,14 +66,14 @@ public function testPushRemoveMultipleChannels() $remove->stubFor("/v1/push/sub-key/demo/devices/coolDevice") ->withQuery([ "remove" => "ch1,ch2", - "type" => "mpns", + "type" => "fcm", "pnsdk" => $this->pubnub_demo->getSdkFullName(), "uuid" => "sampleUUID", ]) ->setResponseBody('[1, "Modified Channels"]'); $result = $remove->channels(['ch1', 'ch2']) - ->pushType(PNPushType::MPNS) + ->pushType(PNPushType::FCM) ->deviceId('coolDevice') ->sync(); @@ -89,7 +89,7 @@ public function testPushRemoveFCM() $remove->stubFor("/v1/push/sub-key/demo/devices/coolDevice") ->withQuery([ "remove" => "ch1,ch2,ch3", - "type" => "gcm", + "type" => "fcm", "pnsdk" => $this->pubnub_demo->getSdkFullName(), "uuid" => "sampleUUID", ]) @@ -102,6 +102,72 @@ public function testPushRemoveFCM() $this->assertNotEmpty($result); } + + public function testWarningWhenUsingDeprecatedGCMType() + { + set_error_handler(static function (int $errno, string $errstr): never { + throw new \Exception($errstr, $errno); + }, E_USER_DEPRECATED); + + try { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('GCM is deprecated. Please use FCM instead.'); + $this->pubnub_demo->getConfiguration()->setUuid("sampleUUID"); + + $remove = new RemoveChannelsFromPushEndpointExposed($this->pubnub_demo); + + $remove->stubFor("/v1/push/sub-key/demo/devices/coolDevice") + ->withQuery([ + "remove" => "ch1,ch2", + "type" => "gcm", + "pnsdk" => $this->pubnub_demo->getSdkFullName(), + "uuid" => "sampleUUID", + ]) + ->setResponseBody('[1, "Modified Channels"]'); + + $result = $remove->channels(['ch1', 'ch2']) + ->pushType(PNPushType::GCM) + ->deviceId('coolDevice') + ->sync(); + + $this->assertNotEmpty($result); + } finally { + restore_error_handler(); + } + } + + public function testWarningWhenUsingDeprecatedAPNSType() + { + set_error_handler(static function (int $errno, string $errstr): never { + throw new \Exception($errstr, $errno); + }, E_USER_DEPRECATED); + + try { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('APNS is deprecated. Please use APNS2 instead.'); + $this->pubnub_demo->getConfiguration()->setUuid("sampleUUID"); + + $remove = new RemoveChannelsFromPushEndpointExposed($this->pubnub_demo); + + $remove->stubFor("/v1/push/sub-key/demo/devices/coolDevice") + ->withQuery([ + "remove" => "ch", + "type" => "apns", + "pnsdk" => $this->pubnub_demo->getSdkFullName(), + "uuid" => "sampleUUID", + ]) + ->setResponseBody('[1, "Modified Channels"]'); + + $result = $remove->channels('ch') + ->pushType(PNPushType::APNS) + ->deviceId('coolDevice') + ->sync(); + + $this->assertNotEmpty($result); + } finally { + restore_error_handler(); + } + } } // phpcs:ignore PSR1.Classes.ClassDeclaration diff --git a/tests/integrational/push/RemoveDeviceFromPushEndpointTest.php b/tests/integrational/push/RemoveDeviceFromPushEndpointTest.php index 1cd0c426..f0d0763c 100644 --- a/tests/integrational/push/RemoveDeviceFromPushEndpointTest.php +++ b/tests/integrational/push/RemoveDeviceFromPushEndpointTest.php @@ -55,27 +55,6 @@ public function testRemovePushAPNS2() $this->assertNotEmpty($result); } - public function testRemovePushMPNS() - { - $this->pubnub_demo->getConfiguration()->setUuid("sampleUUID"); - - $remove = new RemoveDeviceFromPushEndpointExposed($this->pubnub_demo); - - $remove->stubFor("/v1/push/sub-key/demo/devices/coolDevice/remove") - ->withQuery([ - "type" => "mpns", - "pnsdk" => $this->pubnub_demo->getSdkFullName(), - "uuid" => "sampleUUID", - ]) - ->setResponseBody('[1, "Modified Channels"]'); - - $result = $remove->pushType(PNPushType::MPNS) - ->deviceId('coolDevice') - ->sync(); - - $this->assertNotEmpty($result); - } - public function testRemovePushFCM() { $this->pubnub_demo->getConfiguration()->setUuid("sampleUUID"); @@ -84,7 +63,7 @@ public function testRemovePushFCM() $remove->stubFor("/v1/push/sub-key/demo/devices/coolDevice/remove") ->withQuery([ - "type" => "gcm", + "type" => "fcm", "pnsdk" => $this->pubnub_demo->getSdkFullName(), "uuid" => "sampleUUID", ]) @@ -103,25 +82,60 @@ public function testWarningWhenUsingDeprecatedGCMType() throw new \Exception($errstr, $errno); }, E_USER_DEPRECATED); - $this->expectException(\Exception::class); - $this->expectExceptionMessage('GCM is deprecated. Please use FCM instead.'); - $this->pubnub_demo->getConfiguration()->setUuid("sampleUUID"); - - $remove = new RemoveDeviceFromPushEndpointExposed($this->pubnub_demo); - - $remove->stubFor("/v1/push/sub-key/demo/devices/coolDevice/remove") - ->withQuery([ - "type" => "gcm", - "pnsdk" => $this->pubnub_demo->getSdkFullName(), - "uuid" => "sampleUUID", - ]) - ->setResponseBody('[1, "Modified Channels"]'); + try { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('GCM is deprecated. Please use FCM instead.'); + $this->pubnub_demo->getConfiguration()->setUuid("sampleUUID"); + + $remove = new RemoveDeviceFromPushEndpointExposed($this->pubnub_demo); + + $remove->stubFor("/v1/push/sub-key/demo/devices/coolDevice/remove") + ->withQuery([ + "type" => "gcm", + "pnsdk" => $this->pubnub_demo->getSdkFullName(), + "uuid" => "sampleUUID", + ]) + ->setResponseBody('[1, "Modified Channels"]'); + + $result = $remove->pushType(PNPushType::GCM) + ->deviceId('coolDevice') + ->sync(); + + $this->assertNotEmpty($result); + } finally { + restore_error_handler(); + } + } - $result = $remove->pushType(PNPushType::GCM) - ->deviceId('coolDevice') - ->sync(); + public function testWarningWhenUsingDeprecatedAPNSType() + { + set_error_handler(static function (int $errno, string $errstr): never { + throw new \Exception($errstr, $errno); + }, E_USER_DEPRECATED); - $this->assertNotEmpty($result); + try { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('APNS is deprecated. Please use APNS2 instead.'); + $this->pubnub_demo->getConfiguration()->setUuid("sampleUUID"); + + $remove = new RemoveDeviceFromPushEndpointExposed($this->pubnub_demo); + + $remove->stubFor("/v1/push/sub-key/demo/devices/coolDevice/remove") + ->withQuery([ + "type" => "apns", + "pnsdk" => $this->pubnub_demo->getSdkFullName(), + "uuid" => "sampleUUID", + ]) + ->setResponseBody('[1, "Modified Channels"]'); + + $result = $remove->pushType(PNPushType::APNS) + ->deviceId('coolDevice') + ->sync(); + + $this->assertNotEmpty($result); + } finally { + restore_error_handler(); + } } } From 5ac9691af126094f517b0457f26ee3c85cee9005 Mon Sep 17 00:00:00 2001 From: "marcin.cebo" Date: Tue, 28 Oct 2025 17:15:33 +0100 Subject: [PATCH 2/4] lint --- tests/integrational/push/ListPushProvisionsEndpointTest.php | 2 +- .../integrational/push/RemoveChannelsFromPushEndpointTest.php | 4 ++-- tests/integrational/push/RemoveDeviceFromPushEndpointTest.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/integrational/push/ListPushProvisionsEndpointTest.php b/tests/integrational/push/ListPushProvisionsEndpointTest.php index f6728c24..fc8e8bc2 100644 --- a/tests/integrational/push/ListPushProvisionsEndpointTest.php +++ b/tests/integrational/push/ListPushProvisionsEndpointTest.php @@ -122,7 +122,7 @@ public function testWarningWhenUsingDeprecatedGCMType() } } - public function testWarningWhenUsingDeprecatedAPNSType() + public function testWarningWhenUsingDeprecatedAPNSType(): void { set_error_handler(static function (int $errno, string $errstr): never { throw new \Exception($errstr, $errno); diff --git a/tests/integrational/push/RemoveChannelsFromPushEndpointTest.php b/tests/integrational/push/RemoveChannelsFromPushEndpointTest.php index b1c4ceff..aa479ca8 100644 --- a/tests/integrational/push/RemoveChannelsFromPushEndpointTest.php +++ b/tests/integrational/push/RemoveChannelsFromPushEndpointTest.php @@ -103,7 +103,7 @@ public function testPushRemoveFCM() $this->assertNotEmpty($result); } - public function testWarningWhenUsingDeprecatedGCMType() + public function testWarningWhenUsingDeprecatedGCMType(): void { set_error_handler(static function (int $errno, string $errstr): never { throw new \Exception($errstr, $errno); @@ -136,7 +136,7 @@ public function testWarningWhenUsingDeprecatedGCMType() } } - public function testWarningWhenUsingDeprecatedAPNSType() + public function testWarningWhenUsingDeprecatedAPNSType(): void { set_error_handler(static function (int $errno, string $errstr): never { throw new \Exception($errstr, $errno); diff --git a/tests/integrational/push/RemoveDeviceFromPushEndpointTest.php b/tests/integrational/push/RemoveDeviceFromPushEndpointTest.php index f0d0763c..fdab1f00 100644 --- a/tests/integrational/push/RemoveDeviceFromPushEndpointTest.php +++ b/tests/integrational/push/RemoveDeviceFromPushEndpointTest.php @@ -107,7 +107,7 @@ public function testWarningWhenUsingDeprecatedGCMType() } } - public function testWarningWhenUsingDeprecatedAPNSType() + public function testWarningWhenUsingDeprecatedAPNSType(): void { set_error_handler(static function (int $errno, string $errstr): never { throw new \Exception($errstr, $errno); From f259effa10b88323ea7322f15090ef50440af17d Mon Sep 17 00:00:00 2001 From: "marcin.cebo" Date: Wed, 29 Oct 2025 13:03:21 +0100 Subject: [PATCH 3/4] lint --- src/PubNub/Enums/PNPushType.php | 1 - tests/integrational/ListPushProvisionsTest.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/PubNub/Enums/PNPushType.php b/src/PubNub/Enums/PNPushType.php index af86f91f..d967d459 100644 --- a/src/PubNub/Enums/PNPushType.php +++ b/src/PubNub/Enums/PNPushType.php @@ -4,7 +4,6 @@ class PNPushType { - public const APNS2 = "apns2"; public const FCM = "fcm"; diff --git a/tests/integrational/ListPushProvisionsTest.php b/tests/integrational/ListPushProvisionsTest.php index 7d22b866..7918a9de 100644 --- a/tests/integrational/ListPushProvisionsTest.php +++ b/tests/integrational/ListPushProvisionsTest.php @@ -72,7 +72,7 @@ public function testIsAuthRequiredSuccess() $response = $list->deviceId("coolDevice") ->pushType(PNPushType::APNS2) - ->topic( "coolTopic") + ->topic("coolTopic") ->sync(); $this->assertInstanceOf(\PubNub\Models\Consumer\Push\PNPushListProvisionsResult::class, $response); From 9d4bbfcd434659e7a4241ecc9c24879d0a79e6ed Mon Sep 17 00:00:00 2001 From: PubNub Release Bot <120067856+pubnub-release-bot@users.noreply.github.com> Date: Thu, 30 Oct 2025 11:00:14 +0000 Subject: [PATCH 4/4] PubNub SDK 9.0.0 release. --- .pubnub.yml | 15 ++++++++++++--- CHANGELOG.md | 10 ++++++++++ README.md | 2 +- composer.json | 2 +- src/PubNub/PubNub.php | 2 +- 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.pubnub.yml b/.pubnub.yml index 418d25bc..3d7b7080 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -1,8 +1,17 @@ name: php -version: 8.0.2 +version: 9.0.0 schema: 1 scm: github.com/pubnub/php changelog: + - date: 2025-10-30 + version: 9.0.0 + changes: + - type: feature + text: "Added limit and offset parameters for hereNow. Number of returned users per channel by default is limited to 1000. Breaking change." + - type: bug + text: "Removed possibility to use deprecated MPNS(Microsoft Push Notification Service). Breaking change." + - type: bug + text: "Added deprecation warning for old APNS PushType. ." - date: 2025-05-29 version: 8.0.2 changes: @@ -534,8 +543,8 @@ sdks: - x86-64 - distribution-type: library distribution-repository: GitHub release - package-name: php-8.0.2.zip - location: https://github.com/pubnub/php/releases/tag/8.0.2 + package-name: php-9.0.0.zip + location: https://github.com/pubnub/php/releases/tag/9.0.0 requires: - name: rmccue/requests min-version: 1.0.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c038187..7e31fb87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## 9.0.0 +October 30 2025 + +#### Added +- Added limit and offset parameters for hereNow. Number of returned users per channel by default is limited to 1000. Breaking change. + +#### Fixed +- Removed possibility to use deprecated MPNS(Microsoft Push Notification Service). Breaking change. +- Added deprecation warning for old APNS PushType. . + ## 8.0.2 May 29 2025 diff --git a/README.md b/README.md index 624631c1..950decf4 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ You will need the publish and subscribe keys to authenticate your app. Get your { "require": { - "pubnub/pubnub": "8.0.2" + "pubnub/pubnub": "9.0.0" } } ``` diff --git a/composer.json b/composer.json index 8b8c34ed..ef8a668d 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "keywords": ["api", "real-time", "realtime", "real time", "ajax", "push"], "homepage": "http://www.pubnub.com/", "license": "proprietary", - "version": "8.0.2", + "version": "9.0.0", "authors": [ { "name": "PubNub", diff --git a/src/PubNub/PubNub.php b/src/PubNub/PubNub.php index 726d8f6e..4619a779 100644 --- a/src/PubNub/PubNub.php +++ b/src/PubNub/PubNub.php @@ -69,7 +69,7 @@ class PubNub implements LoggerAwareInterface { - protected const SDK_VERSION = "8.0.2"; + protected const SDK_VERSION = "9.0.0"; protected const SDK_NAME = "PubNub-PHP"; public static $MAX_SEQUENCE = 65535;