Skip to content

Commit 01154b4

Browse files
mohitpubnubMohit Tejanipubnub-release-bot
authored
refactor/use 'fcm' instead 'gcm' for push notification service (#484)
* replace `gcm` with `fcm` for push notification gateway type. since google stopped supporting gcm * replaced `pn_gcm` with `pn_fcm` for push notification payload builder utility * update lib and dist * PubNub SDK v10.2.2 release. --------- Co-authored-by: Mohit Tejani <[email protected]> Co-authored-by: PubNub Release Bot <[email protected]>
1 parent d8b92af commit 01154b4

File tree

25 files changed

+100
-89
lines changed

25 files changed

+100
-89
lines changed

.pubnub.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
---
22
changelog:
3+
- date: 2025-11-19
4+
version: v10.2.2
5+
changes:
6+
- type: improvement
7+
text: "Replace `gcm` with `fcm` for push notification gateway type."
38
- date: 2025-11-03
49
version: v10.2.1
510
changes:
@@ -1359,7 +1364,7 @@ supported-platforms:
13591364
- 'Ubuntu 14.04 and up'
13601365
- 'Windows 7 and up'
13611366
version: 'Pubnub Javascript for Node'
1362-
version: '10.2.1'
1367+
version: '10.2.2'
13631368
sdks:
13641369
- full-name: PubNub Javascript SDK
13651370
short-name: Javascript
@@ -1375,7 +1380,7 @@ sdks:
13751380
- distribution-type: source
13761381
distribution-repository: GitHub release
13771382
package-name: pubnub.js
1378-
location: https://github.com/pubnub/javascript/archive/refs/tags/v10.2.1.zip
1383+
location: https://github.com/pubnub/javascript/archive/refs/tags/v10.2.2.zip
13791384
requires:
13801385
- name: 'agentkeepalive'
13811386
min-version: '3.5.2'
@@ -2046,7 +2051,7 @@ sdks:
20462051
- distribution-type: library
20472052
distribution-repository: GitHub release
20482053
package-name: pubnub.js
2049-
location: https://github.com/pubnub/javascript/releases/download/v10.2.1/pubnub.10.2.1.js
2054+
location: https://github.com/pubnub/javascript/releases/download/v10.2.2/pubnub.10.2.2.js
20502055
requires:
20512056
- name: 'agentkeepalive'
20522057
min-version: '3.5.2'

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v10.2.2
2+
November 19 2025
3+
4+
#### Modified
5+
- Replace `gcm` with `fcm` for push notification gateway type.
6+
17
## v10.2.1
28
November 03 2025
39

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ Watch [Getting Started with PubNub JS SDK](https://app.dashcam.io/replay/64ee0d2
2727
npm install pubnub
2828
```
2929
* or download one of our builds from our CDN:
30-
* https://cdn.pubnub.com/sdk/javascript/pubnub.10.2.1.js
31-
* https://cdn.pubnub.com/sdk/javascript/pubnub.10.2.1.min.js
30+
* https://cdn.pubnub.com/sdk/javascript/pubnub.10.2.2.js
31+
* https://cdn.pubnub.com/sdk/javascript/pubnub.10.2.2.min.js
3232
3333
2. Configure your keys:
3434

dist/web/pubnub.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5436,7 +5436,7 @@
54365436
return base.PubNubFile;
54375437
},
54385438
get version() {
5439-
return '10.2.1';
5439+
return '10.2.2';
54405440
},
54415441
getVersion() {
54425442
return this.version;
@@ -8160,7 +8160,7 @@
81608160
if (platforms.includes('fcm')) {
81618161
const fcmPayload = this.fcm.toObject();
81628162
if (fcmPayload && Object.keys(fcmPayload).length)
8163-
payload.pn_gcm = fcmPayload;
8163+
payload.pn_fcm = fcmPayload;
81648164
}
81658165
if (Object.keys(payload).length && this._debugging)
81668166
payload.pn_debug = true;
@@ -13240,7 +13240,7 @@
1324013240
(!('channels' in this.parameters) || this.parameters.channels.length === 0))
1324113241
return 'Missing Channels';
1324213242
if (!pushGateway)
13243-
return 'Missing GW Type (pushGateway: gcm or apns2)';
13243+
return 'Missing GW Type (pushGateway: fcm or apns2)';
1324413244
if (this.parameters.pushGateway === 'apns2' && !this.parameters.topic)
1324513245
return 'Missing APNS2 topic';
1324613246
}

dist/web/pubnub.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs-snippets/basic-usage/mobile-push.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ try {
3131
const response = await pubnub.push.addChannels({
3232
channels: ['a', 'b'],
3333
device: 'niceDevice',
34-
pushGateway: 'gcm',
34+
pushGateway: 'fcm',
3535
});
3636
console.log('device added to channels response:', response);
3737
} catch (error) {
@@ -68,7 +68,7 @@ try {
6868
try {
6969
const response = await pubnub.push.listChannels({
7070
device: 'niceDevice',
71-
pushGateway: 'gcm',
71+
pushGateway: 'fcm',
7272
});
7373

7474
console.log('listing channels for device response:', response);
@@ -110,7 +110,7 @@ try {
110110
const response = await pubnub.push.removeChannels({
111111
channels: ['a', 'b'],
112112
device: 'niceDevice',
113-
pushGateway: 'gcm',
113+
pushGateway: 'fcm',
114114
});
115115

116116
console.log('removing device from channel response:', response);
@@ -147,7 +147,7 @@ try {
147147
try {
148148
const response = await pubnub.push.deleteDevice({
149149
device: 'niceDevice',
150-
pushGateway: 'gcm',
150+
pushGateway: 'fcm',
151151
});
152152

153153
console.log('deleteDevice response:', response);

lib/core/components/configuration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ const makeConfiguration = (base, setupCryptoModule) => {
168168
return base.PubNubFile;
169169
},
170170
get version() {
171-
return '10.2.1';
171+
return '10.2.2';
172172
},
173173
getVersion() {
174174
return this.version;

lib/core/components/push_payload.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ class NotificationsPayload {
613613
if (platforms.includes('fcm')) {
614614
const fcmPayload = this.fcm.toObject();
615615
if (fcmPayload && Object.keys(fcmPayload).length)
616-
payload.pn_gcm = fcmPayload;
616+
payload.pn_fcm = fcmPayload;
617617
}
618618
if (Object.keys(payload).length && this._debugging)
619619
payload.pn_debug = true;

lib/core/endpoints/push/push.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class BasePushNotificationChannelsRequest extends request_1.AbstractRequest {
5050
(!('channels' in this.parameters) || this.parameters.channels.length === 0))
5151
return 'Missing Channels';
5252
if (!pushGateway)
53-
return 'Missing GW Type (pushGateway: gcm or apns2)';
53+
return 'Missing GW Type (pushGateway: fcm or apns2)';
5454
if (this.parameters.pushGateway === 'apns2' && !this.parameters.topic)
5555
return 'Missing APNS2 topic';
5656
}

lib/types/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4006,7 +4006,7 @@ declare namespace PubNub {
40064006
};
40074007

40084008
/**
4009-
* Payload for `pn_gcm` field in published message.
4009+
* Payload for `pn_fcm` field in published message.
40104010
*/
40114011
type FCMPayload = {
40124012
/**
@@ -4400,7 +4400,7 @@ declare namespace PubNub {
44004400
*/
44014401
buildPayload(platforms: ('apns' | 'apns2' | 'fcm')[]): {
44024402
pn_apns?: APNSPayload;
4403-
pn_gcm?: FCMPayload;
4403+
pn_fcm?: FCMPayload;
44044404
pn_debug?: boolean;
44054405
};
44064406
}
@@ -8927,7 +8927,7 @@ declare namespace PubNub {
89278927
/**
89288928
* Push Notifications gateway type.
89298929
*/
8930-
pushGateway: 'gcm';
8930+
pushGateway: 'fcm';
89318931
};
89328932

89338933
/**

0 commit comments

Comments
 (0)