Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: python
version: 10.4.0
version: 10.4.1
schema: 1
scm: github.com/pubnub/python
sdks:
Expand All @@ -18,7 +18,7 @@ sdks:
distributions:
- distribution-type: library
distribution-repository: package
package-name: pubnub-10.4.0
package-name: pubnub-10.4.1
location: https://pypi.org/project/pubnub/
supported-platforms:
supported-operating-systems:
Expand Down Expand Up @@ -94,8 +94,8 @@ sdks:
-
distribution-type: library
distribution-repository: git release
package-name: pubnub-10.4.0
location: https://github.com/pubnub/python/releases/download/10.4.0/pubnub-10.4.0.tar.gz
package-name: pubnub-10.4.1
location: https://github.com/pubnub/python/releases/download/10.4.1/pubnub-10.4.1.tar.gz
supported-platforms:
supported-operating-systems:
Linux:
Expand Down Expand Up @@ -169,6 +169,11 @@ sdks:
license-url: https://github.com/encode/httpx/blob/master/LICENSE.md
is-required: Required
changelog:
- date: 2025-06-05
version: 10.4.1
changes:
- type: bug
text: "Fixed add_channel_to_push and remove_channel_from_push endpoints."
- date: 2025-05-07
version: 10.4.0
changes:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 10.4.1
June 05 2025

#### Fixed
- Fixed add_channel_to_push and remove_channel_from_push endpoints.

## 10.4.0
May 07 2025

Expand Down
2 changes: 1 addition & 1 deletion pubnub/endpoints/push/remove_channels_from_push.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def create_response(self, envelope) -> PNPushRemoveChannelResult:
return PNPushRemoveChannelResult()

def sync(self) -> PNPushRemoveChannelResultEnvelope:
return PNPushRemoveChannelResultEnvelope(self.process_sync())
return PNPushRemoveChannelResultEnvelope(super().sync())

def is_auth_required(self):
return True
Expand Down
2 changes: 1 addition & 1 deletion pubnub/pubnub_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ def list_push_channels(self, device_id: str = None, push_type: PNPushType = None
"""
return ListPushProvisions(self, device_id=device_id, push_type=push_type, topic=topic, environment=environment)

def add_channels_to_push(self, channels: Union[str, List[str]], device_id: str = None,
def add_channels_to_push(self, channels: Union[str, List[str]] = None, device_id: str = None,
push_type: PNPushType = None, topic: str = None,
environment: PNPushEnvironment = None) -> AddChannelsToPush:
"""Register channels for push notifications.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='pubnub',
version='10.4.0',
version='10.4.1',
description='PubNub Real-time push service in the cloud',
author='PubNub',
author_email='support@pubnub.com',
Expand Down
15 changes: 14 additions & 1 deletion tests/functional/push/test_add_channels_to_push.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
import pubnub.enums

from pubnub.endpoints.push.add_channels_to_push import AddChannelsToPush
from tests.helper import pnconf, sdk_name
from tests.helper import pnconf, pnconf_env_copy, sdk_name
from pubnub.managers import TelemetryManager
from pubnub.enums import PNPushType, PNPushEnvironment


class TestAddChannelsFromPush(unittest.TestCase):
Expand Down Expand Up @@ -89,3 +90,15 @@ def test_push_add_single_channel_apns2(self):
})

self.assertEqual(self.add_channels._channels, ['ch'])

def test_add_channels_to_push_builder(self):
config = pnconf_env_copy()
pubnub = PubNub(config)
endpoint = pubnub.add_channels_to_push() \
.channels(['ch1', 'ch2']) \
.device_id("00000000000000000000000000000000") \
.push_type(PNPushType.APNS2) \
.environment(PNPushEnvironment.PRODUCTION) \
.topic("testTopic")
result = endpoint.sync()
self.assertEqual(result.status.error, None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"version": 1,
"interactions": [
{
"request": {
"method": "GET",
"uri": "https://ps.pndsn.com/v2/push/sub-key/{PN_KEY_SUBSCRIBE}/devices-apns2/0000000000000000?add=apns2_channel_1%2Capns2_channel_2&environment=development&topic=com.example.testapp.notifications&uuid=test-uuid",
"body": "",
"headers": {
"host": [
"ps.pndsn.com"
],
"accept": [
"*/*"
],
"accept-encoding": [
"gzip, deflate"
],
"connection": [
"keep-alive"
],
"user-agent": [
"PubNub-Python/10.4.0"
]
}
},
"response": {
"status": {
"code": 200,
"message": "OK"
},
"headers": {
"Date": [
"Thu, 05 Jun 2025 11:59:00 GMT"
],
"Content-Type": [
"text/javascript; charset=\"UTF-8\""
],
"Content-Length": [
"24"
],
"Connection": [
"keep-alive"
],
"Cache-Control": [
"no-cache"
],
"Access-Control-Allow-Methods": [
"GET, POST, DELETE, OPTIONS"
],
"Access-Control-Allow-Credentials": [
"true"
],
"Access-Control-Expose-Headers": [
"*"
]
},
"body": {
"pickle": "gASVKAAAAAAAAAB9lIwGc3RyaW5nlIwYWzEsICJNb2RpZmllZCBDaGFubmVscyJdlHMu"
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"version": 1,
"interactions": [
{
"request": {
"method": "GET",
"uri": "https://ps.pndsn.com/v2/push/sub-key/{PN_KEY_SUBSCRIBE}/devices-apns2/0000000000000000?add=apns2_dev_channel_1%2Capns2_dev_channel_2&environment=development&topic=com.example.testapp.notifications&uuid=test-uuid",
"body": "",
"headers": {
"host": [
"ps.pndsn.com"
],
"accept": [
"*/*"
],
"accept-encoding": [
"gzip, deflate"
],
"connection": [
"keep-alive"
],
"user-agent": [
"PubNub-Python/10.4.0"
]
}
},
"response": {
"status": {
"code": 200,
"message": "OK"
},
"headers": {
"Date": [
"Thu, 05 Jun 2025 11:59:01 GMT"
],
"Content-Type": [
"text/javascript; charset=\"UTF-8\""
],
"Content-Length": [
"24"
],
"Connection": [
"keep-alive"
],
"Cache-Control": [
"no-cache"
],
"Access-Control-Allow-Methods": [
"GET, POST, DELETE, OPTIONS"
],
"Access-Control-Allow-Credentials": [
"true"
],
"Access-Control-Expose-Headers": [
"*"
]
},
"body": {
"pickle": "gASVKAAAAAAAAAB9lIwGc3RyaW5nlIwYWzEsICJNb2RpZmllZCBDaGFubmVscyJdlHMu"
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"version": 1,
"interactions": [
{
"request": {
"method": "GET",
"uri": "https://ps.pndsn.com/v2/push/sub-key/{PN_KEY_SUBSCRIBE}/devices-apns2/0000000000000000?add=apns2_prod_channel_1%2Capns2_prod_channel_2&environment=production&topic=com.example.testapp.notifications&uuid=test-uuid",
"body": "",
"headers": {
"host": [
"ps.pndsn.com"
],
"accept": [
"*/*"
],
"accept-encoding": [
"gzip, deflate"
],
"connection": [
"keep-alive"
],
"user-agent": [
"PubNub-Python/10.4.0"
]
}
},
"response": {
"status": {
"code": 200,
"message": "OK"
},
"headers": {
"Date": [
"Thu, 05 Jun 2025 11:59:02 GMT"
],
"Content-Type": [
"text/javascript; charset=\"UTF-8\""
],
"Content-Length": [
"24"
],
"Connection": [
"keep-alive"
],
"Cache-Control": [
"no-cache"
],
"Access-Control-Allow-Methods": [
"GET, POST, DELETE, OPTIONS"
],
"Access-Control-Allow-Credentials": [
"true"
],
"Access-Control-Expose-Headers": [
"*"
]
},
"body": {
"pickle": "gASVKAAAAAAAAAB9lIwGc3RyaW5nlIwYWzEsICJNb2RpZmllZCBDaGFubmVscyJdlHMu"
}
}
}
]
}
Loading
Loading