You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
isAlwaysUseFCM:false, // true all messages will be sent through node-gcm (which actually uses FCM)
95
+
isAlwaysUseFCM:false, // true all messages will be sent through gcm/fcm api
96
+
isLegacyGCM:false// if true gcm messages will be sent through node-gcm (deprecated api), if false gcm messages will be sent through 'firebase-admin' lib
97
+
90
98
};
91
99
constpush=newPushNotifications(settings);
92
100
```
93
101
94
102
- GCM options: see [node-gcm](https://github.com/ToothlessGear/node-gcm#custom-gcm-request-options)
103
+
- FCM options: see [firebase-admin](https://firebase.google.com/docs/admin/setup) (read [FCM](#fcm) section below!)
95
104
- APN options: see [node-apn](https://github.com/node-apn/node-apn/blob/master/doc/provider.markdown)
96
105
- ADM options: see [node-adm](https://github.com/umano/node-adm)
97
106
- WNS options: see [wns](https://github.com/tjanczuk/wns)
@@ -486,7 +495,8 @@ The following parameters are used to create an APN message:
486
495
collapseId:data.collapseKey,
487
496
mutableContent:data.mutableContent||0,
488
497
threadId:data.threadId,
489
-
pushType:data.pushType
498
+
pushType:data.pushType,
499
+
rawPayload:data.rawPayload
490
500
}
491
501
```
492
502
@@ -496,6 +506,7 @@ _data is the parameter in `push.send(registrationIds, data)`_
496
506
- **Please note** that `topic` is required ([see node-apn docs](https://github.com/node-apn/node-apn/blob/master/doc/notification.markdown#notificationtopic)). When using token-based authentication, specify the bundle ID of the app.
497
507
When using certificate-based authentication, the topic is usually your app's bundle ID.
498
508
More details can be found under https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns
509
+
- `rawPayload` (hidden 'node-apn' lib notification param) [source code](https://github.com/node-apn/node-apn/blob/master/lib/notification/index.js#L99) this param will replace all payload
499
510
500
511
### Silent push notifications
501
512
@@ -519,6 +530,94 @@ const silentPushData = {
519
530
}
520
531
```
521
532
533
+
## FCM
534
+
The following parameters are used to create an FCM message (Android/APN):
535
+
[node-gcm](https://github.com/ToothlessGear/node-gcm) lib for `GCM` method use old firebase api (will be [deprecated ](https://firebase.google.com/docs/cloud-messaging/migrate-v1?hl=en&authuser=0))
- `settings.fcm.serviceAccountKey` [firebase service account file](https://firebase.google.com/docs/admin/setup#initialize_the_sdk_in_non-google_environments) use downloaded 'service-account-file.json'
Fcm object that will be sent to provider ([Fcm message format](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages?authuser=0#Message)) :
0 commit comments